Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 3d2b1be

Browse files
refactor($compile): check removeWatches before calling
Previously we assigned `noop` if there was no function but there is no performance advantage in doing this since the check would have to happen either at assignment time or at call time. Removing this use of `noop` makes the code clearer, IMO :-) Closes #12528
1 parent f08a0c5 commit 3d2b1be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ng/compile.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2019,7 +2019,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
20192019
controllerForBindings = controller;
20202020
removeControllerBindingWatches =
20212021
initializeDirectiveBindings(scope, attrs, controller.instance,
2022-
bindings, scopeDirective) || noop;
2022+
bindings, scopeDirective);
20232023
}
20242024
}
20252025
for (i in elementControllers) {
@@ -2033,7 +2033,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
20332033
$element.data('$' + i + 'Controller', controllerResult);
20342034
if (controller === controllerForBindings) {
20352035
// Remove and re-install bindToController bindings
2036-
removeControllerBindingWatches();
2036+
removeControllerBindingWatches && removeControllerBindingWatches();
20372037
removeControllerBindingWatches =
20382038
initializeDirectiveBindings(scope, attrs, controllerResult, bindings, scopeDirective);
20392039
}

0 commit comments

Comments
 (0)