Skip to content

Add each_with_index and each_set_index methods #13

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

Closed
wants to merge 2 commits into from

Conversation

ggrossman
Copy link

Hi @tyler!

I'd like to propose a couple new methods for this gem:

  • each_with_index which provides the integer index as well as whether the bit is a 1 or 0. For many use cases, it's useful to know the index of the bit.
  • each_set_index which efficiently iterates over only the 1's in the bit set.

Other changes:

  • I also got a deprecation warning about rdoctask so I tweaked it to rdoc/task.
  • rb_bitset_marshall_load and rb_bitset_marshall_dump are misspelled, should be marshal

Thanks for considering!

@ggrossman ggrossman changed the title Ggrossman/each methods Add each_with_index and each_set_index methods Mar 14, 2022
@ggrossman
Copy link
Author

Ah, now I see #11 by @ericboesch already covers this

@ggrossman ggrossman closed this Mar 14, 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.

1 participant