yonik commented on a change in pull request #826: SOLR-13399: add splitByPrefix configuration to IndexSizeTrigger URL: https://github.com/apache/lucene-solr/pull/826#discussion_r312981845
########## File path: solr/core/src/java/org/apache/solr/handler/admin/SplitOp.java ########## @@ -385,16 +385,8 @@ static String toSplitString(Collection<DocRouter.Range> splits) throws Exception // compare to current prefix bucket and see if this new term shares the same prefix if (term != null && term.length >= currPrefix.length && currPrefix.length > 0) { - int i = 0; - for (; i < currPrefix.length; i++) { - if (currPrefix.bytes[i] != term.bytes[term.offset + i]) { - break; - } - } - - if (i == currPrefix.length) { - // prefix was the same (common-case fast path) - // int count = termsEnum.docFreq(); + BytesRef termPrefix = new BytesRef(term.bytes, term.offset, currPrefix.length); Review comment: Found a better choice here that doesn't involve object creation: StringHelper.startsWith() ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org