fix iterator ending

This commit is contained in:
yuanchuan 2017-02-26 23:16:21 +08:00
parent 1033eeeed9
commit 205412ac8e
2 changed files with 2 additions and 2 deletions

View File

@ -305,7 +305,7 @@ function iterator(input) {
return {
curr: (n = 0) => input[index + n],
next: () => input[index++],
end: () => input.length - 1 <= index,
end: () => input.length <= index,
index: () => index
};
}

View File

@ -33,7 +33,7 @@ function iterator(input) {
return {
curr: (n = 0) => input[index + n],
next: () => input[index++],
end: () => input.length - 1 <= index,
end: () => input.length <= index,
index: () => index
};
}