Skip to content

refactor: add members #10

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

Merged
merged 3 commits into from
May 16, 2025
Merged

Conversation

brech1
Copy link
Collaborator

@brech1 brech1 commented May 15, 2025

Description

This PR optimizes the add_members function in src/group.rs by changing the input from Vec<Element> to &[Element], reducing memory overhead by avoiding vector cloning. Tests in src/group.rs and tests/group.rs are updated to use slice syntax.

It also fixes clippy and docs warnings.

  • What kind of change? Performance optimization (refactoring)
  • Current behavior: add_members requires an owned Vec<Element>, causing unnecessary cloning.
  • New behavior: Accepts &[Element] slice for efficient reference passing.
  • Breaking change? Yes, users must update calls to pass slices instead of vectors.

Related Issue(s)

Other information

All unit tests pass locally with updated slice syntax. No additional documentation changes needed.

Checklist

  • I have read and understand the contributor guidelines and code of conduct.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • I have run cargo fmt without getting any errors.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

@vplasencia vplasencia merged commit 0d2c7e4 into semaphore-protocol:main May 16, 2025
2 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.

Optimize add_members in Group
2 participants