Skip to content

Commit

Permalink
[Java] Return null if Int2IntHashMap.remove(Integer) method is the mi…
Browse files Browse the repository at this point in the history
…ssingValue. Issue #98.
  • Loading branch information
mjpt777 committed May 11, 2017
1 parent 611341a commit 9cc06a2
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,8 @@ public Set<Entry<Integer, Integer>> entrySet()
*/
public Integer remove(final Object key)
{
final int intKey = (int)key;
if (intKey == missingValue)
{
throw new IllegalArgumentException("missing value not allowed: " + missingValue);
}

return remove(intKey);
final int value = remove((int)key);
return value == missingValue ? null : value;
}

public int remove(final int key)
Expand Down

0 comments on commit 9cc06a2

Please sign in to comment.