mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 21:18:58 +00:00
(keyoword-extractor) Address very rare race condition in memoization logic
This commit is contained in:
parent
f797a92f87
commit
9b781f8404
@ -105,9 +105,10 @@ public class KeywordExtractor {
|
||||
|
||||
|
||||
public WordSpan[] getKeywordsFromSentence(DocumentSentence sentence) {
|
||||
if (sentence.keywords != null) {
|
||||
return sentence.keywords.get();
|
||||
}
|
||||
var existingKeywords = sentence.keywords.get();
|
||||
if (existingKeywords != null)
|
||||
return existingKeywords;
|
||||
|
||||
List<WordSpan> spans = new ArrayList<>(2 * sentence.length());
|
||||
|
||||
for (int i = 0; i < sentence.length(); i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user