Skip to content

Commit 0e02989

Browse files
alancutterericwilligers
authored andcommitted
Optimise for when there are no apply hooks
1 parent 6fd042d commit 0e02989

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/extension-api.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -71,24 +71,24 @@
7171
}
7272

7373
function clearApplyHooks(effectSet) {
74-
for (var id in effectSet) {
75-
var effect = effectSet[id];
76-
applyHooks.forEach(function(applyHook) {
74+
applyHooks.forEach(function(applyHook) {
75+
for (var id in effectSet) {
76+
var effect = effectSet[id];
7777
var style = effect._target.style;
7878
if (!style._applyHookAffectedProperties) {
7979
return;
8080
}
8181
for (var property in style._applyHookAffectedProperties) {
8282
style._clear(property);
8383
}
84-
});
85-
}
84+
}
85+
});
8686
};
8787

8888
function callApplyHooks(effectSet) {
89-
for (var id in effectSet) {
90-
var effect = effectSet[id];
91-
applyHooks.forEach(function(applyHook) {
89+
applyHooks.forEach(function(applyHook) {
90+
for (var id in effectSet) {
91+
var effect = effectSet[id];
9292
if (!effect._target._webAnimationsPatchedStyle) {
9393
return;
9494
}
@@ -108,8 +108,8 @@
108108
style._set(property, newValues[property]);
109109
affectedProperties[property] = true;
110110
}
111-
});
112-
}
111+
}
112+
});
113113
};
114114

115115
scope.clearApplyHooks = clearApplyHooks;

0 commit comments

Comments
 (0)