mirror of
https://github.com/wassname/phaser.git
synced 2026-07-03 17:10:40 +08:00
Merge pull request #85 from onedayitwillmake/dev
Fixed accidentally overwroting remove function with a prepend function
This commit is contained in:
+8
-11
@@ -87,17 +87,14 @@ Phaser.LinkedList.prototype = {
|
||||
* @param {object} child - Description.
|
||||
*/
|
||||
remove: function (child) {
|
||||
if( this.first ) {
|
||||
child.next = this.last.next;
|
||||
child.prev = this.last;
|
||||
if( this.last.next ) {
|
||||
this.last.next.prev = child;
|
||||
}
|
||||
this.last.next = child;
|
||||
this.last = this.last.next;
|
||||
} else {
|
||||
this.first = this.last = child;
|
||||
}
|
||||
if( child == this.first ) this.first = this.first.next; // It was 'first', make 'first' point to first.next
|
||||
else if ( child == this.last ) this.last = this.last.prev; // It was 'last', make 'last' point to last.prev
|
||||
|
||||
if( child.prev ) child.prev.next = child.next; // make child.prev.next point to childs.next instead of child
|
||||
if( child.next ) child.next.prev = child.prev; // make child.next.prev point to child.prev instead of child
|
||||
child.next = child.prev = null;
|
||||
|
||||
if( this.first == null ) this.last = null;
|
||||
|
||||
this.total--;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user