Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add null check for relativeTo parameter in GetTabletToElementTransform #10107

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lindexi
Copy link
Member

@lindexi lindexi commented Nov 22, 2024

Fixes #

Main PR

Description

Modified the GetTabletToElementTransform method to include a null check for the relativeTo parameter. The StylusDevice.GetElementTransform(relativeTo) is now only added to the group when relativeTo is not null. This change reduces unnecessary method calls when relativeTo is null, minimizes allocations of the FrugalStructList within the GeneralTransformCollection, and enhances performance.

Customer Impact

Minor Performance Optimization

Regression

Testing

Just CI

Risk

Low. There are no logical dependencies. And the behavior before and after the code changes is identical.

Microsoft Reviewers: Open in CodeFlow

…form`

Modified the `GetTabletToElementTransform` method to include a null check for the `relativeTo` parameter. The `StylusDevice.GetElementTransform(relativeTo)` is now only added to the `group` when `relativeTo` is not null. This change reduces unnecessary method calls when `relativeTo` is null, minimizes allocations of the FrugalStructList within the `GeneralTransformCollection`, and enhances performance.
@lindexi lindexi requested review from a team as code owners November 22, 2024 09:44
@dotnet-policy-service dotnet-policy-service bot added PR metadata: Label to tag PRs, to facilitate with triage Community Contribution A label for all community Contributions labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant