Skip to content

Add mutable Reject#901

Open
hizani wants to merge 1 commit into
samber:masterfrom
hizani:filter-reject-efficient
Open

Add mutable Reject#901
hizani wants to merge 1 commit into
samber:masterfrom
hizani:filter-reject-efficient

Conversation

@hizani

@hizani hizani commented Jun 2, 2026

Copy link
Copy Markdown

This PR adds mutable.Reject that uses the same algorithm as mutable.Filter, but the predicate return is reversed

@hizani

hizani commented Jun 2, 2026

Copy link
Copy Markdown
Author

I just found out that there is the mutable package, so I will move new stuff there

@hizani hizani marked this pull request as draft June 2, 2026 13:11
@hizani hizani force-pushed the filter-reject-efficient branch from 04f70f6 to bf1e202 Compare June 2, 2026 13:45
@hizani

hizani commented Jun 2, 2026

Copy link
Copy Markdown
Author

Added mutable Reject and mutable and not mutable FilterRejectUnstable

@hizani hizani marked this pull request as ready for review June 2, 2026 13:47
@mattg-imprint

Copy link
Copy Markdown

I think update the PR description to reflect the change to use the mutable package.

@hizani hizani changed the title Efficient Filter and Reject implementations Add mutable Reject and FilterRejectUnstable implementations Jun 3, 2026
@hizani

hizani commented Jun 3, 2026

Copy link
Copy Markdown
Author

Done

@samber

samber commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Hey @hizani

Thanks for this first contribution.

Can you split this and move FilterRejectUnstable to a dedicated PR please ?

I'm going to merge the Reject helper.

About the FilterRejectUnstable, it seems very specific to me. I would like to receive more feedback before accepting it.

No is temporary. Yes is forever.

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.35%. Comparing base (0875232) to head (bf1e202).

Files with missing lines Patch % Lines
mutable/slice.go 43.75% 18 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #901      +/-   ##
==========================================
- Coverage   92.62%   92.35%   -0.27%     
==========================================
  Files          32       32              
  Lines        5110     5155      +45     
==========================================
+ Hits         4733     4761      +28     
- Misses        274      291      +17     
  Partials      103      103              
Flag Coverage Δ
unittests 92.35% <60.00%> (-0.27%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

@hizani hizani force-pushed the filter-reject-efficient branch from bf1e202 to 86060d4 Compare June 10, 2026 18:08
@hizani hizani changed the title Add mutable Reject and FilterRejectUnstable implementations Add mutable Reject Jun 10, 2026
@hizani

hizani commented Jun 10, 2026

Copy link
Copy Markdown
Author

Moved FilterRejectUnstable to a separate PR: #904

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