Permalink
Browse files

Fix bug in 'slice'

'next' was executed for every element in source, regardless of range
  • Loading branch information...
tonyskn committed Nov 2, 2011
1 parent d15ae8b commit 4577f61278c985a263899ca3b34bf26a5626c4ea
Showing with 1 addition and 1 deletion.
  1. +1 −1 core.js
View
@@ -275,7 +275,7 @@ function slice(source, start, end) {
filter(function(element) {
return start <= index ++
}, source)(function onElement(element) {
- return next(element), index >= end ? (stop(), false) : true
+ return (index <= end && next(element)), index >= end ? (stop(), false) : true
}, stop = limit(stop))
}
}

0 comments on commit 4577f61

Please sign in to comment.