lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpou...@apache.org
Subject [lucene-solr] branch master updated: CompetitiveImpactAccumulator should protect its costly invariant checks behind an `assert`.
Date Mon, 20 Jan 2020 10:27:17 GMT
This is an automated email from the ASF dual-hosted git repository.

jpountz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/master by this push:
     new bddb06b  CompetitiveImpactAccumulator should protect its costly invariant checks
behind an `assert`.
bddb06b is described below

commit bddb06b6508c82010f1e51834089cd94b1a2eb1e
Author: Adrien Grand <jpountz@gmail.com>
AuthorDate: Mon Jan 20 11:16:09 2020 +0100

    CompetitiveImpactAccumulator should protect its costly invariant checks behind an `assert`.
---
 .../java/org/apache/lucene/codecs/CompetitiveImpactAccumulator.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lucene/core/src/java/org/apache/lucene/codecs/CompetitiveImpactAccumulator.java
b/lucene/core/src/java/org/apache/lucene/codecs/CompetitiveImpactAccumulator.java
index 5909602..fca6455 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/CompetitiveImpactAccumulator.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/CompetitiveImpactAccumulator.java
@@ -63,7 +63,7 @@ public final class CompetitiveImpactAccumulator {
   public void clear() {
     Arrays.fill(maxFreqs, 0);
     otherFreqNormPairs.clear();
-    assertConsistent();
+    assert assertConsistent();
   }
 
   /** Accumulate a (freq,norm) pair, updating this structure if there is no
@@ -75,7 +75,7 @@ public final class CompetitiveImpactAccumulator {
     } else {
       add(new Impact(freq, norm), otherFreqNormPairs);
     }
-    assertConsistent();
+    assert assertConsistent();
   }
 
   /** Merge {@code acc} into this. */
@@ -90,7 +90,7 @@ public final class CompetitiveImpactAccumulator {
       add(entry, otherFreqNormPairs);
     }
 
-    assertConsistent();
+    assert assertConsistent();
   }
 
   /** Get the set of competitive freq and norm pairs, ordered by increasing freq and norm.
*/


Mime
View raw message