projects
/
org.ibex.core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
js delete key fix
[org.ibex.core.git]
/
src
/
org
/
ibex
/
util
/
Hash.java
diff --git
a/src/org/ibex/util/Hash.java
b/src/org/ibex/util/Hash.java
index
4b38870
..
4ee02c8
100644
(file)
--- a/
src/org/ibex/util/Hash.java
+++ b/
src/org/ibex/util/Hash.java
@@
-151,21
+151,22
@@
public class Hash {
}
private class HashEnum implements java.util.Enumeration {
}
private class HashEnum implements java.util.Enumeration {
- private int iterator = 0;
- private int found = 0;
+ private int iterator;
+
+ public HashEnum() { findNext(); }
+
+ private void findNext() {
+ while(iterator < keys1.length && (keys1[iterator] == null || keys1[iterator] == placeholder)) iterator++;
+ }
public boolean hasMoreElements() {
public boolean hasMoreElements() {
- return found < usedslots;
+ return iterator < keys1.length;
}
public Object nextElement() {
}
public Object nextElement() {
- if (!hasMoreElements()) throw new java.util.NoSuchElementException();
-
- Object o = null;
- while (o == null) o = keys1[iterator++];
- if (o == null) throw new IllegalStateException("Didn't find an element, when I should have.");
- found++;
-
+ if (iterator == keys1.length) throw new NoSuchElementException();
+ Object o = keys1[iterator];
+ findNext();
return o;
}
}
return o;
}
}