Optimise LinkedList filter ops to return iterator instead of array (#6035)

* filter ops don't LinkedList to array anymore

* LL.tiddlerIterator -> LL.makeTiddlerIterator

LinkedList method name change.
This commit is contained in:
Cameron Fischer
2021-09-16 22:22:44 +01:00
committed by GitHub
parent dcff318a98
commit e9d8547a81
3 changed files with 11 additions and 2 deletions
+9
View File
@@ -95,6 +95,15 @@ LinkedList.prototype.toArray = function() {
return output;
};
LinkedList.prototype.makeTiddlerIterator = function(wiki) {
var self = this;
return function(callback) {
self.each(function(title) {
callback(wiki.getTiddler(title),title);
});
};
};
function _removeOne(list,value) {
var prevEntry = list.prev[value],
nextEntry = list.next[value],