chibenwa commented on code in PR #2583:
URL: https://github.com/apache/james-project/pull/2583#discussion_r1903911269


##########
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/search/OpenSearchSearchHighlighter.java:
##########
@@ -100,6 +97,21 @@ private SearchSnippet buildSearchSnippet(Hit<ObjectNode> 
searchResult) {
     }
 
     private String shortenGreaterThanCharacters(String text) {
-        return GREATER_THAN_PATTERN.matcher(text).replaceAll(">");
+        StringBuilder result = new StringBuilder();
+        boolean previousIsTarget = false;
+
+        for (char c : text.toCharArray()) {

Review Comment:
   I have doubts about char iteration method.
   
   Maybe we could bench with JMH this version and the REGEXP one?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to