Skip to content

Conversation

@h3xds1nz
Copy link
Member

@h3xds1nz h3xds1nz commented Jul 1, 2024

Description

Removes redundant type checks second-time around when constructing CachedBitmap (this constructor is used by BitmapSource.Create(). There's minimal performance benefit, the main goal here is code simplification, that has been made possible with the introduction of GetArrayDataReference few releases ago.

Method has been tested with all array types for correct functionality when constructing in-memory Bitmap.

Customer Impact

Smaller code-size of PresentationCore.

Regression

None.

Testing

Build, constructing Bitmap from memory source.

Risk

Low.

Microsoft Reviewers: Open in CodeFlow

@h3xds1nz h3xds1nz requested review from a team as code owners July 1, 2024 21:00
@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 Jul 1, 2024
@h3xds1nz h3xds1nz force-pushed the cached-bitmap-ctor-fix branch from 53b6c11 to a3521c6 Compare July 13, 2024 10:36
@h3xds1nz h3xds1nz changed the title [CachedBitmap.cs] Simplify constructor by removing duplicate type checks Simplify constructor in CachedBitmap by removing duplicate type checks Sep 1, 2024
@siagupta0202 siagupta0202 self-assigned this Jan 13, 2025
@siagupta0202
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@h3xds1nz
Copy link
Member Author

@siagupta0202 The auto merge results in a missing using for System.Runtime.InteropServices, I'll add it later today.

By the way, #9395 is almost the same if you wanna have a look.

@h3xds1nz h3xds1nz force-pushed the cached-bitmap-ctor-fix branch from a3521c6 to 8953fd2 Compare January 15, 2025 07:51
@siagupta0202
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@siagupta0202 siagupta0202 merged commit 2fa8170 into dotnet:main Jan 15, 2025
8 checks passed
@siagupta0202
Copy link
Contributor

@h3xds1nz Thank you for your contribution!

@h3xds1nz
Copy link
Member Author

@siagupta0202 Thank you :)

@github-actions github-actions bot locked and limited conversation to collaborators Feb 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

3 participants