kopia lustrzana https://github.com/backface/turtlestitch
fix List::length to work with stored CS10 projects
rodzic
ff854784c0
commit
3dbe001d6f
|
@ -2196,3 +2196,8 @@ ______
|
||||||
* Threads: fixed #506, thanks @haritop, for both the report and for providing the fix!!
|
* Threads: fixed #506, thanks @haritop, for both the report and for providing the fix!!
|
||||||
* GUI: fixed #412 (incomplete sprite-removal)
|
* GUI: fixed #412 (incomplete sprite-removal)
|
||||||
* GUI: fixed #507 (limit persistent block zoom to 12x), thanks Michael!
|
* GUI: fixed #507 (limit persistent block zoom to 12x), thanks Michael!
|
||||||
|
* Morphic, GUI, Objects: fixed #508 (don’t popup empty menus), thanks Michael!
|
||||||
|
|
||||||
|
140714
|
||||||
|
------
|
||||||
|
* Lists: make internal list ops iterative (instead of recursive), thanks, Brian!
|
||||||
|
|
4
lists.js
4
lists.js
|
@ -195,11 +195,11 @@ List.prototype.length = function () {
|
||||||
if (this.isLinked) {
|
if (this.isLinked) {
|
||||||
var pair = this,
|
var pair = this,
|
||||||
result = 0;
|
result = 0;
|
||||||
while (pair.isLinked) {
|
while (pair && pair.isLinked) {
|
||||||
result += 1;
|
result += 1;
|
||||||
pair = pair.rest;
|
pair = pair.rest;
|
||||||
}
|
}
|
||||||
return result + pair.contents.length;
|
return result + (pair ? pair.contents.length : 0);
|
||||||
}
|
}
|
||||||
return this.contents.length;
|
return this.contents.length;
|
||||||
};
|
};
|
||||||
|
|
Ładowanie…
Reference in New Issue