mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-11 03:13:51 +00:00
perf[set]: add unboxed contains method to HashSetInt
This commit is contained in:
1 parent
4addf11543
commit
09f1c9fd70
2 files changed
+8
No files matched your search
@@ -53,6 +53,10 @@ public class HashSetInt extends AbstractSet<Integer> {
|
||||
return map.containsKey(o);
|
||||
}
|
||||
|
||||
public boolean contains(int key) {
|
||||
return map.containsKey(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(Integer e) {
|
||||
return map.put(e, Boolean.TRUE) == null;
|
||||
|
||||
@@ -53,6 +53,10 @@ public class HashSetShort extends AbstractSet<Short> {
|
||||
return map.containsKey(o);
|
||||
}
|
||||
|
||||
public boolean contains(short key) {
|
||||
return map.containsKey(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(Short e) {
|
||||
return map.put(e, Boolean.TRUE) == null;
|
||||
|
||||
Reference in new issue
Block a user