Skip to content

Commit

Permalink
perf(lang-textmate): call caching in OnigRegExp
Browse files Browse the repository at this point in the history
  • Loading branch information
dingyi222666 authored and Rosemoe committed Jan 30, 2024
1 parent a286ac0 commit 945f30c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ public OnigRegExp(final String pattern, final boolean ignoreCase) {
}
}

var result = search(str.bytesUTF8, startPosition, str.bytesCount);
synchronized (this) {
lastSearchString = str;
lastSearchPosition = startPosition;
lastSearchResult = search(str.bytesUTF8, startPosition, str.bytesCount);
lastSearchResult = result;
}
return lastSearchResult;
}
Expand Down

0 comments on commit 945f30c

Please sign in to comment.