Skip to content

Commit

Permalink
Optimize native animated connection queue handling (facebook#25256)
Browse files Browse the repository at this point in the history
Summary:
Change O(n^2) to O(n)

Minor follow-up to: facebook#24177

## Changelog

[Internal] [Changed] - Optimize native animated connection queue handling
Pull Request resolved: facebook#25256

Differential Revision: D15804527

Pulled By: cpojer

fbshipit-source-id: 4a1e1b51faf6ed7b98eb08aa47e18cfaea541dad
  • Loading branch information
msand authored and M-i-k-e-l committed Mar 10, 2020
1 parent 4d78c96 commit 8756b36
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Libraries/Animated/src/NativeAnimatedHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ const API = {
disableQueue: function(): void {
invariant(NativeAnimatedModule, 'Native animated module is not available');
queueConnections = false;
while (queue.length) {
const args = queue.shift();
for (let q = 0, l = queue.length; q < l; q++) {
const args = queue[q];
NativeAnimatedModule.connectAnimatedNodes(args[0], args[1]);
}
queue.length = 0;
},
createAnimatedNode: function(tag: ?number, config: AnimatedNodeConfig): void {
invariant(NativeAnimatedModule, 'Native animated module is not available');
Expand Down

0 comments on commit 8756b36

Please sign in to comment.