kopia lustrzana https://github.com/backface/turtlestitch
refactored blockSequence() non-recursively
rodzic
fc95262732
commit
fbc5da9e9d
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
### 2020-12-17
|
### 2020-12-17
|
||||||
* blocks: added hook for caching variadic inputs
|
* blocks: added hook for caching variadic inputs
|
||||||
|
* blocks: refactored blockSequence() non-recursively
|
||||||
|
|
||||||
### 2020-12-16
|
### 2020-12-16
|
||||||
* threads, objects: added dev debugging hook for counting yields
|
* threads, objects: added dev debugging hook for counting yields
|
||||||
|
|
|
||||||
|
|
@ -4818,12 +4818,13 @@ CommandBlockMorph.prototype.init = function () {
|
||||||
// CommandBlockMorph enumerating:
|
// CommandBlockMorph enumerating:
|
||||||
|
|
||||||
CommandBlockMorph.prototype.blockSequence = function () {
|
CommandBlockMorph.prototype.blockSequence = function () {
|
||||||
var nb = this.nextBlock(),
|
var sequence = [this],
|
||||||
result = [this];
|
nb = this.nextBlock();
|
||||||
if (nb) {
|
while (nb) {
|
||||||
result = result.concat(nb.blockSequence());
|
sequence.push(nb);
|
||||||
|
nb = nb.nextBlock();
|
||||||
}
|
}
|
||||||
return result;
|
return sequence;
|
||||||
};
|
};
|
||||||
|
|
||||||
CommandBlockMorph.prototype.bottomBlock = function () {
|
CommandBlockMorph.prototype.bottomBlock = function () {
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue