Avoid sticking a fork in things if we are asked to remove a null key.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4268 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -324,6 +324,13 @@ public class DSet<E extends DSet.Entry>
|
|||||||
*/
|
*/
|
||||||
protected E removeKey (Comparable key)
|
protected E removeKey (Comparable key)
|
||||||
{
|
{
|
||||||
|
// don't fail, but generate a warning if we're passed a null key
|
||||||
|
if (key == null) {
|
||||||
|
Log.warning("Requested to remove null key.");
|
||||||
|
Thread.dumpStack();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// look up this entry's position in our set
|
// look up this entry's position in our set
|
||||||
int eidx = ArrayUtil.binarySearch(
|
int eidx = ArrayUtil.binarySearch(
|
||||||
_entries, 0, _size, key, ENTRY_COMP);
|
_entries, 0, _size, key, ENTRY_COMP);
|
||||||
|
|||||||
Reference in New Issue
Block a user