Skip to content

Remove pointless std::vector#2511

Open
dg0yt wants to merge 1 commit intolibigl:mainfrom
dg0yt:snap_rounding
Open

Remove pointless std::vector#2511
dg0yt wants to merge 1 commit intolibigl:mainfrom
dg0yt:snap_rounding

Conversation

@dg0yt
Copy link
Copy Markdown

@dg0yt dg0yt commented Oct 31, 2025

It is not necessary and not efficient to use a std::vector for max. 8 elements only to iterate them once for calculating the sum of the input: The sum can be calculated directly instead.

Originally, this spot caught my attention because

cen = Vector_2(cen.x()/EScalar(hits.size()),cen.y()/EScalar(hits.size()));

caused issues in x86 MSVC.

Unfortunately, it is not covered by a test. Offering it as a draft.

Checklist

  • All changes meet libigl style-guidelines.
  • Adds new .cpp file.
  • Adds corresponding unit test.
  • This is a minor change.

@dg0yt dg0yt marked this pull request as ready for review January 28, 2026 06:56
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.

1 participant