File tree Expand file tree Collapse file tree 3 files changed +9
-18
lines changed
fastfilter/src/main/java/org/fastfilter/xor Expand file tree Collapse file tree 3 files changed +9
-18
lines changed Original file line number Diff line number Diff line change @@ -200,12 +200,9 @@ private void addAll(long[] keys) {
200200
201201 if (hashIndex > 100 ) {
202202 // if construction doesn't succeed eventually,
203- // then there is likely a problem with the hash function
204- // let us not crash the system:
205- for (int i = 0 ; i < fingerprints .length ; i ++) {
206- fingerprints [i ] = (short )0xFFFF ;
207- }
208- return ;
203+ // then there is likely a problem with the hash function.
204+ // It's better fail that either produce non-functional or incorrect filter.
205+ throw new IllegalArgumentException ("could not construct filter" );
209206 }
210207 // use a new random numbers
211208 seed = Hash .randomSeed ();
Original file line number Diff line number Diff line change @@ -200,12 +200,9 @@ private void addAll(long[] keys) {
200200
201201 if (hashIndex > 100 ) {
202202 // if construction doesn't succeed eventually,
203- // then there is likely a problem with the hash function
204- // let us not crash the system:
205- for (int i = 0 ; i < fingerprints .length ; i ++) {
206- fingerprints [i ] = (int ) 0xFFFFFFFF ;
207- }
208- return ;
203+ // then there is likely a problem with the hash function.
204+ // It's better fail that either produce non-functional or incorrect filter.
205+ throw new IllegalArgumentException ("could not construct filter" );
209206 }
210207 // use a new random numbers
211208 seed = Hash .randomSeed ();
Original file line number Diff line number Diff line change @@ -200,12 +200,9 @@ private void addAll(long[] keys) {
200200
201201 if (hashIndex > 100 ) {
202202 // if construction doesn't succeed eventually,
203- // then there is likely a problem with the hash function
204- // let us not crash the system:
205- for (int i = 0 ; i < fingerprints .length ; i ++) {
206- fingerprints [i ] = (byte )0xFF ;
207- }
208- return ;
203+ // then there is likely a problem with the hash function.
204+ // It's better fail that either produce non-functional or incorrect filter.
205+ throw new IllegalArgumentException ("could not construct filter" );
209206 }
210207 // use a new random numbers
211208 seed = Hash .randomSeed ();
You can’t perform that action at this time.
0 commit comments