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:
db9fd95
)
enumerate arrays in order
author
brian
<brian@brianweb.net>
Tue, 6 Apr 2004 22:18:32 +0000
(22:18 +0000)
committer
brian
<brian@brianweb.net>
Tue, 6 Apr 2004 22:18:32 +0000
(22:18 +0000)
darcs-hash:
20040406221832
-24bed-
8de747278674da5068153a44fbf3e14479af1b0a
.gz
src/org/ibex/js/JSArray.java
patch
|
blob
|
history
diff --git
a/src/org/ibex/js/JSArray.java
b/src/org/ibex/js/JSArray.java
index
bf54947
..
7b90de7
100644
(file)
--- a/
src/org/ibex/js/JSArray.java
+++ b/
src/org/ibex/js/JSArray.java
@@
-99,11
+99,11
@@
public class JSArray extends JS {
public Enumeration keys() {
return new Enumeration() {
- private int cur = 0;
- public boolean hasMoreElements() { return cur < size(); }
+ private int n = size();
+ public boolean hasMoreElements() { return n > 0; }
public Object nextElement() {
- if (cur >= size()) throw new NoSuchElementException();
- return new Integer(cur++);
+ if(n == 0) throw new NoSuchElementException();
+ return new Integer(--n);
}
};
}