Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

convenience method for length #18

Open
futurechan opened this issue Nov 19, 2014 · 5 comments
Open

convenience method for length #18

futurechan opened this issue Nov 19, 2014 · 5 comments

Comments

@futurechan
Copy link

Is there a way to get the total number of items in the buffer?

Also, I want to completely dump the buffer by calling .pop() in iteration. Can I call .pop and then check the size until the size is zero?

@futurechan
Copy link
Author

I ended up calling .pop() and then checking if the result is undefined, but I'm still curious if there is a way to continuously check the size of the buffer without calling .toArray().length.

@trevnorris
Copy link
Owner

b.size is what you want.

@trevnorris
Copy link
Owner

Actually, leaving open as a reminder this needs to be documented.

@trevnorris trevnorris reopened this Dec 3, 2014
@matbee-eth
Copy link

What would be really nice is a remaining size. :)

@trevnorris
Copy link
Owner

@acidhax Could add a convince method, but should only need cb.length - cb.size.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants