Skip to content

Commit

Permalink
Use states and not values to remove in _K__V_HashMap.TValueView.
Browse files Browse the repository at this point in the history
Fixes #25.
Fix proposed by Tim Wilson.
Signed-off-by: Jean-Yves Tinevez <jean-yves.tinevez@pasteur.fr>
  • Loading branch information
tinevez authored and sebkur committed Jul 11, 2017
1 parent 9fe2a0a commit 5c48bac
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -864,18 +864,17 @@ public class T#K##V#HashMap extends T#K##V#Hash implements T#K##V#Map, Externali
/** {@inheritDoc} */
public boolean remove( #v# entry ) {
#v#[] values = _values;
#k#[] set = _set;
byte[] states = _states;

for ( int i = values.length; i-- > 0; ) {
if ( ( set[i] != FREE && set[i] != REMOVED ) && entry == values[i] ) {
if ( ( states[i] != FREE && states[i] != REMOVED ) && entry == values[i] ) {
removeAt( i );
return true;
}
}
return false;
}


/** {@inheritDoc} */
public boolean containsAll( Collection<?> collection ) {
for ( Object element : collection ) {
Expand Down

0 comments on commit 5c48bac

Please sign in to comment.