mirror of https://github.com/apache/lucene.git
Use short-circuit boolean expressions (#13042)
This commit is contained in:
parent
7832d3c9fe
commit
fe4631c8d2
|
@ -69,7 +69,7 @@ public class TestSearchWithThreads extends LuceneTestCase {
|
|||
try {
|
||||
long totHits = 0;
|
||||
long totSearch = 0;
|
||||
for (; totSearch < numSearches & !failed.get(); totSearch++) {
|
||||
for (; totSearch < numSearches && !failed.get(); totSearch++) {
|
||||
totHits += s.search(new TermQuery(new Term("body", "aaa")), collectorManager);
|
||||
totHits += s.search(new TermQuery(new Term("body", "bbb")), collectorManager);
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ public class TestWeakIdentityMap extends LuceneTestCase {
|
|||
for (Iterator<String> it = map.keyIterator(); it.hasNext(); ) {
|
||||
assertTrue(it.hasNext()); // try again, should return same result!
|
||||
final String k = it.next();
|
||||
assertTrue(k == key1 || k == key2 | k == key3);
|
||||
assertTrue(k == key1 || k == key2 || k == key3);
|
||||
keysAssigned += (k == key1) ? 1 : ((k == key2) ? 2 : 4);
|
||||
c++;
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ public class TestUTF32ToUTF8 extends LuceneTestCase {
|
|||
code = x;
|
||||
}
|
||||
if ((code >= UnicodeUtil.UNI_SUR_HIGH_START && code <= UnicodeUtil.UNI_SUR_HIGH_END)
|
||||
| (code >= UnicodeUtil.UNI_SUR_LOW_START && code <= UnicodeUtil.UNI_SUR_LOW_END)) {
|
||||
|| (code >= UnicodeUtil.UNI_SUR_LOW_START && code <= UnicodeUtil.UNI_SUR_LOW_END)) {
|
||||
iter--;
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue