Skip to content

Commit adb3b2d

Browse files
committed
js插件对频繁new的对象应该用对象池 #974
kbengine/kbengine#974
1 parent 453fd98 commit adb3b2d

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

kbengine.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,20 +1095,20 @@ KBEngine.Bundle = function()
10951095
}
10961096

10971097
this.reclaimObject = function()
1098-
{
1098+
{
10991099
this.clear();
11001100

11011101
if(KBEngine.Bundle._objects != undefined)
1102-
KBEngine.Bundle._objects.push(this);
1103-
}
1102+
KBEngine.Bundle._objects.push(this);
1103+
}
11041104
}
11051105

11061106
KBEngine.Bundle.createObject = function()
11071107
{
1108-
if(KBEngine.Bundle._objects == undefined)
1109-
KBEngine.Bundle._objects = [];
1110-
1111-
return KBEngine.Bundle._objects.length > 0 ? KBEngine.Bundle._objects.pop() : new KBEngine.Bundle();
1108+
if(KBEngine.Bundle._objects == undefined)
1109+
KBEngine.Bundle._objects = [];
1110+
1111+
return KBEngine.Bundle._objects.length > 0 ? KBEngine.Bundle._objects.pop() : new KBEngine.Bundle();
11121112
}
11131113

11141114
/*-----------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)