kopia lustrzana https://github.com/backface/turtlestitch
refactored blockSequence() non-recursively
rodzic
fc95262732
commit
fbc5da9e9d
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 () {
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue