mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IdIndexEntry: fix always true != on different objects, avoid allocation if possible
GitOrigin-RevId: 29ca05230623c996c0b909fba285c279fea8571e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2f4d50c774
commit
b7f2777d52
+4
-3
@@ -21,9 +21,10 @@ public class IdDataConsumer {
|
||||
if (end == start) return;
|
||||
final IdIndexEntry entry = new IdIndexEntry(charSequence, start, end, true);
|
||||
addOccurrence(entry, occurrenceMask);
|
||||
final IdIndexEntry entryNoCase = new IdIndexEntry(charSequence, start, end, false);
|
||||
if (entryNoCase != entry) {
|
||||
addOccurrence(entryNoCase, occurrenceMask);
|
||||
|
||||
int hashNoCase = IdIndexEntry.getWordHash(charSequence, start, end, false);
|
||||
if (hashNoCase != entry.getWordHashCode()) {
|
||||
addOccurrence(new IdIndexEntry(hashNoCase), occurrenceMask);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ public final class IdIndexEntry {
|
||||
return "IdIndexEntry[hash: " + myWordHashCode +"]";
|
||||
}
|
||||
|
||||
private static int getWordHash(@NotNull CharSequence line, int start, int end, boolean caseSensitive) {
|
||||
static int getWordHash(@NotNull CharSequence line, int start, int end, boolean caseSensitive) {
|
||||
if (start == end) return 0;
|
||||
char firstChar = line.charAt(start);
|
||||
char lastChar = line.charAt(end - 1);
|
||||
|
||||
Reference in New Issue
Block a user