10000 reverse() is far more of a pass-thru Sequence now, excluding a cache … · powercoder23/immutable-js@c3b6f9a · GitHub
[go: up one dir, main page]

Skip to content

Commit c3b6f9a

Browse files
committed
reverse() is far more of a pass-thru Sequence now, excluding a cache of its own. It gets a lazy iterator
1 parent 03f5b49 commit c3b6f9a

File tree

3 files changed

+36
-11
lines changed

3 files changed

+36
-11
lines changed

dist/Immutable.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,28 @@ var $Sequence = Sequence;
379379
return sequence;
380380
});
381381
reversedSequence.length = sequence.length;
382-
reversedSequence.__iterateUncached = function(fn, reverse) {
382+
reversedSequence.get = (function(key, notSetValue) {
383+
return sequence.get(key, notSetValue);
384+
});
385+
reversedSequence.has = (function(key) {
386+
return sequence.has(key);
387+
});
388+
reversedSequence.contains = (function(value) {
389+
return sequence.contains(value);
390+
});
391+
reversedSequence.cacheResult = function() {
392+
sequence.cacheResult();
393+
this.length = sequence.length;
394+
};
395+
reversedSequence.__iterate = function(fn, reverse) {
383396
var $__0 = this;
384397
return sequence.__iterate((function(v, k) {
385398
return fn(v, k, $__0);
386399
}), !reverse);
387400
};
401+
reversedSequence.__iterator = (function(type, reverse) {
402+
return sequence.__iterator(type, !reverse);
403+
});
388404
return reversedSequence;
389405
},
390406
keySeq: function() {

0 commit comments

Comments
 (0)
0