Commit 490c5e8
Avoid repeated allocations in getChildOffsetRelativeToRoot (#55274)
Summary:
Pull Request resolved: #55274
Changelog: [Internal]
Refactors `getChildOffsetRelativeToRoot()` to use a static `Rect` field instead of allocating a new `Rect` and `int[]` on every call. Since this is a private method, we can return the `Rect` directly to avoid the extra `int[]` allocation.
This addresses the code review feedback on D90988373.
Reviewed By: javache
Differential Revision: D91230611
fbshipit-source-id: 64eb23e24f46488075252dafbfbf16a44cf34f671 parent 4cfb2ee commit 490c5e8
1 file changed
Lines changed: 8 additions & 9 deletions
File tree
- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager
Lines changed: 8 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
| 58 | + | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
| |||
659 | 658 | | |
660 | 659 | | |
661 | 660 | | |
662 | | - | |
| 661 | + | |
663 | 662 | | |
664 | | - | |
| 663 | + | |
665 | 664 | | |
666 | 665 | | |
667 | 666 | | |
| |||
677 | 676 | | |
678 | 677 | | |
679 | 678 | | |
680 | | - | |
| 679 | + | |
| 680 | + | |
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
684 | 684 | | |
685 | | - | |
| 685 | + | |
686 | 686 | | |
687 | | - | |
688 | | - | |
689 | | - | |
| 687 | + | |
| 688 | + | |
690 | 689 | | |
691 | 690 | | |
692 | 691 | | |
| |||
0 commit comments