refactored blockSequence() non-recursively

pull/95/head
jmoenig 2020-12-17 15:26:05 +01:00
rodzic fc95262732
commit fbc5da9e9d
2 zmienionych plików z 7 dodań i 5 usunięć

Wyświetl plik

@ -9,6 +9,7 @@
### 2020-12-17
* blocks: added hook for caching variadic inputs
* blocks: refactored blockSequence() non-recursively
### 2020-12-16
* threads, objects: added dev debugging hook for counting yields

Wyświetl plik

@ -4818,12 +4818,13 @@ CommandBlockMorph.prototype.init = function () {
// CommandBlockMorph enumerating:
CommandBlockMorph.prototype.blockSequence = function () {
var nb = this.nextBlock(),
result = [this];
if (nb) {
result = result.concat(nb.blockSequence());
var sequence = [this],
nb = this.nextBlock();
while (nb) {
sequence.push(nb);
nb = nb.nextBlock();
}
return result;
return sequence;
};
CommandBlockMorph.prototype.bottomBlock = function () {