projects
/
org.ibex.core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
reorganized file layout (part 1: moves and renames)
[org.ibex.core.git]
/
src
/
org
/
ibex
/
js
/
JSArray.java
diff --git
a/src/org/ibex/js/JSArray.java
b/src/org/ibex/js/JSArray.java
index
f29b79a
..
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() {
public Enumeration keys() {
return new Enumeration() {
- int cur = 0;
- public boolean hasMoreElements() { return cur >= size(); }
+ private int n = size();
+ public boolean hasMoreElements() { return n > 0; }
public Object nextElement() {
public Object nextElement() {
- if (cur >= size()) throw new NoSuchElementException();
- return new Integer(cur++);
+ if(n == 0) throw new NoSuchElementException();
+ return new Integer(--n);
}
};
}
}
};
}