Skip to content
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

Semantics of length and size switched? #23

Open
wherget opened this issue Jun 17, 2016 · 1 comment
Open

Semantics of length and size switched? #23

wherget opened this issue Jun 17, 2016 · 1 comment

Comments

@wherget
Copy link
Contributor

wherget commented Jun 17, 2016

I was trying to use this for backing a d3.js graph, and after a bit of debugging found that (to me) it looks like the semantics of .length and .size are the wrong way around. That is to say, for a "plain" JS Array, .length is (usually, except for some edge cases) the number of elements in the array, what is CBuffer.size here.

For using CBuffer as a "drop-in" replacement for a plain old Array, exchanging these meanings might be helpful. What do you think?

@trevnorris
Copy link
Owner

Cool. Want to open a PR?

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

No branches or pull requests

2 participants