Skip to content

Avoid repeated allocations in getChildOffsetRelativeToRoot#55274

Closed
fabriziocucci wants to merge 1 commit intofacebook:mainfrom
fabriziocucci:export-D91230611
Closed

Avoid repeated allocations in getChildOffsetRelativeToRoot#55274
fabriziocucci wants to merge 1 commit intofacebook:mainfrom
fabriziocucci:export-D91230611

Conversation

@fabriziocucci
Copy link
Copy Markdown
Contributor

Summary:
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.

Differential Revision: D91230611

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 22, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Jan 22, 2026

@fabriziocucci has exported this pull request. If you are a Meta employee, you can view the originating Diff in D91230611.

…55274)

Summary:

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
@meta-codesync meta-codesync Bot closed this in 490c5e8 Jan 23, 2026
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jan 23, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Jan 23, 2026

This pull request has been merged in 490c5e8.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @fabriziocucci in 490c5e8

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants