Skip to content

perf: correct prealloc of the result in FindUniques/Duplicates[By]#764

Merged
samber merged 1 commit intosamber:masterfrom
d-enk:correct-prealloc-find-uniq-dupl-result
Jan 12, 2026
Merged

perf: correct prealloc of the result in FindUniques/Duplicates[By]#764
samber merged 1 commit intosamber:masterfrom
d-enk:correct-prealloc-find-uniq-dupl-result

Conversation

@d-enk
Copy link
Contributor

@d-enk d-enk commented Jan 12, 2026

Track exact duplicate count during detection phase instead of incorrect estimating capacity as len(collection)-len(isDupl).

Also simplify map update logic and rename ok -> seen for clarity.

@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.20%. Comparing base (eb9719c) to head (d493bc8).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #764   +/-   ##
=======================================
  Coverage   94.20%   94.20%           
=======================================
  Files          18       18           
  Lines        2880     2884    +4     
=======================================
+ Hits         2713     2717    +4     
  Misses        151      151           
  Partials       16       16           
Flag Coverage Δ
unittests 94.20% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Track exact duplicate count during detection phase instead of
incorrect estimating capacity as len(collection)-len(isDupl).

Also simplify map update logic and rename ok -> seen for clarity.
@d-enk d-enk force-pushed the correct-prealloc-find-uniq-dupl-result branch from 44abdf6 to d493bc8 Compare January 12, 2026 18:50
@d-enk d-enk changed the title perf(FindUniques/Duplicates[By]): correct prealloc of the result perf: correct prealloc of the result in FindUniques/Duplicates[By] Jan 12, 2026
@samber samber merged commit 7755390 into samber:master Jan 12, 2026
19 of 20 checks passed
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.

2 participants