Null properties? I don't see the point.

This commit is contained in:
Zixaphir 2014-01-05 10:34:23 -07:00
parent 482f6444fe
commit bb5dcaa409
3 changed files with 3 additions and 17 deletions

View File

@ -1460,8 +1460,6 @@
RandomAccessList = (function() {
function RandomAccessList() {
this.first = null;
this.last = null;
this.length = 0;
}
@ -1469,10 +1467,7 @@
var ID, last;
ID = item.ID;
last = this.last;
$.extend(item, {
prev: last,
next: null
});
item.prev = last;
this[ID] = item;
this.last = last ? last.next = item : this.first = item;
return this.length++;

View File

@ -1466,8 +1466,6 @@
RandomAccessList = (function() {
function RandomAccessList() {
this.first = null;
this.last = null;
this.length = 0;
}
@ -1475,10 +1473,7 @@
var ID, last;
ID = item.ID;
last = this.last;
$.extend(item, {
prev: last,
next: null
});
item.prev = last;
this[ID] = item;
this.last = last ? last.next = item : this.first = item;
return this.length++;

View File

@ -1,15 +1,11 @@
class RandomAccessList
constructor: ->
@first = null
@last = null
@length = 0
push: (item) ->
{ID} = item
{last} = @
$.extend item,
prev: last
next: null
item.prev = last
@[ID] = item
@last = if last
last.next = item