projects
/
org.ibex.core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eb8d7e6
)
2003/12/07 07:16:46
author
megacz
<megacz@xwt.org>
Fri, 30 Jan 2004 07:42:36 +0000
(07:42 +0000)
committer
megacz
<megacz@xwt.org>
Fri, 30 Jan 2004 07:42:36 +0000
(07:42 +0000)
darcs-hash:
20040130074236
-2ba56-
256c10fc2f836e588fecc2d6ff189924a4358bf8
.gz
src/org/xwt/util/Hash.java
patch
|
blob
|
history
diff --git
a/src/org/xwt/util/Hash.java
b/src/org/xwt/util/Hash.java
index
e36f667
..
cdd37c6
100644
(file)
--- a/
src/org/xwt/util/Hash.java
+++ b/
src/org/xwt/util/Hash.java
@@
-51,9
+51,7
@@
public class Hash {
}
/** returns all the primary keys in the table */
}
/** returns all the primary keys in the table */
- public Enumeration keys() {
- return new HashEnum(this);
- }
+ public Enumeration keys() { return new HashEnum(); }
public Hash() { this(25, 3); }
public Hash(int initialcapacity, int loadFactor) {
public Hash() { this(25, 3); }
public Hash(int initialcapacity, int loadFactor) {
@@
-146,25
+144,21
@@
public class Hash {
vals[dest] = v;
}
vals[dest] = v;
}
- class HashEnum implements java.util.Enumeration {
- private final Hash parent;
+ private class HashEnum implements java.util.Enumeration {
private int iterator = 0;
private int found = 0;
private int iterator = 0;
private int found = 0;
- public HashEnum (Hash parent) { this.parent = parent; }
+ public HashEnum () { }
public boolean hasMoreElements() {
public boolean hasMoreElements() {
- return found < parent.usedslots;
+ return found < usedslots;
}
public Object nextElement() {
if (!hasMoreElements()) throw new java.util.NoSuchElementException();
Object o = null;
}
public Object nextElement() {
if (!hasMoreElements()) throw new java.util.NoSuchElementException();
Object o = null;
- while (o == null) {
- o = parent.keys1[iterator++];
- }
-
+ while (o == null) o = keys1[iterator++];
if (o == null) throw new IllegalStateException("Didn't find an element, when I should have.");
found++;
if (o == null) throw new IllegalStateException("Didn't find an element, when I should have.");
found++;