more efficient splitting, reduces blockfile access

pull/62/head
Zlatin Balevsky 2021-06-05 03:18:18 +01:00
parent cb2ab77316
commit ea1f431323
No known key found for this signature in database
GPG Key ID: A72832072D525E41
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ class SearchIndex {
// first split by split pattern // first split by split pattern
String sourceSplit = source.replaceAll(SplitPattern.SPLIT_PATTERN, " ").toLowerCase() String sourceSplit = source.replaceAll(SplitPattern.SPLIT_PATTERN, " ").toLowerCase()
String [] split = sourceSplit.split(" ") String [] split = sourceSplit.split(" ")
def rv = [] def rv = new HashSet()
split.each { if (it.length() > 0) rv << it } split.each { if (it.length() > 0) rv << it }
// then just by ' ' // then just by ' '