0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-23 09:26:51 -05:00

Optimized Events.trigger method when no event is emitted

This commit is contained in:
Brice Chevalier 2018-01-06 12:17:00 +09:00
parent 0895d81fa1
commit b17cb48dbe

View file

@ -84,7 +84,8 @@ var Common = require('./Common');
callbacks,
eventClone;
if (object.events) {
var events = object.events;
if (events && Object.keys(events).length > 0) {
if (!event)
event = {};
@ -92,7 +93,7 @@ var Common = require('./Common');
for (var i = 0; i < names.length; i++) {
name = names[i];
callbacks = object.events[name];
callbacks = events[name];
if (callbacks) {
eventClone = Common.clone(event, false);