We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent efbf276 commit 7c2bd98Copy full SHA for 7c2bd98
1 file changed
v3/src/sound/BaseSoundManager.js
@@ -198,13 +198,9 @@ var BaseSoundManager = new Class({
198
* @param {number} delta - The delta time elapsed since the last frame.
199
*/
200
update: function (time, delta) {
201
- this.sounds.sort(function (s1, s2) {
202
- return (s1.pendingRemove === s2.pendingRemove) ? 0 : s1 ? 1 : -1;
203
- });
204
- for (var i = 0; i < this.sounds.length; i++) {
+ for (var i = this.sounds.length - 1; i >= 0; i--) {
205
if (this.sounds[i].pendingRemove) {
206
- this.sounds.length = i;
207
- break;
+ this.sounds.splice(i, 1);
208
}
209
210
this.sounds.forEach(function (sound) {
0 commit comments