mirror of
https://github.com/liabru/matter-js.git
synced 2024-12-25 13:39:06 -05:00
optimised Pairs.removeOld
This commit is contained in:
parent
1073ddeecf
commit
a882a74cd5
1 changed files with 2 additions and 1 deletions
|
@ -111,6 +111,7 @@ var Common = require('../core/Common');
|
|||
var pairsList = pairs.list,
|
||||
pairsTable = pairs.table,
|
||||
indexesToRemove = [],
|
||||
pairMaxIdleLife = Pairs._pairMaxIdleLife,
|
||||
pair,
|
||||
collision,
|
||||
pairIndex,
|
||||
|
@ -127,7 +128,7 @@ var Common = require('../core/Common');
|
|||
}
|
||||
|
||||
// if pair is inactive for too long, mark it to be removed
|
||||
if (timestamp - pair.timeUpdated > Pairs._pairMaxIdleLife) {
|
||||
if (timestamp - pair.timeUpdated > pairMaxIdleLife) {
|
||||
indexesToRemove.push(i);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue