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

Determine minX/minY/maxX/maxY by iterating over points/paths only onc… #240

Merged
merged 1 commit into from
Jul 23, 2022

Conversation

remcoros
Copy link
Contributor

…e instead of using Linq

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

While investigating another (solved) issue, I saw this pattern of using Linq to get the minX/minY/length/etc. This iterates over the list multiple times and could be optimized by iterating only once and keeping track of min/max values.

@CLAassistant
Copy link

CLAassistant commented Jul 22, 2022

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Jul 22, 2022

Codecov Report

Merging #240 (0bc8b36) into main (4149a1b) will increase coverage by 0%.
The diff coverage is 100%.

@@         Coverage Diff         @@
##           main   #240   +/-   ##
===================================
  Coverage    71%    71%           
===================================
  Files        88     88           
  Lines      5362   5370    +8     
  Branches   1096   1098    +2     
===================================
+ Hits       3845   3853    +8     
  Misses     1298   1298           
  Partials    219    219           
Flag Coverage Δ
unittests 71% <100%> (+<1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/ImageSharp.Drawing/Shapes/InternalPath.cs 88% <100%> (+<1%) ⬆️
src/ImageSharp.Drawing/Shapes/PathCollection.cs 59% <100%> (+6%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us.

Copy link
Member

@JimBobSquarePants JimBobSquarePants left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks!

@JimBobSquarePants JimBobSquarePants merged commit dc838dc into SixLabors:main Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants