cbuffer icon indicating copy to clipboard operation
cbuffer copied to clipboard

Semantics of length and size switched?

Open wherget opened this issue 8 years ago • 1 comments

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?

wherget avatar Jun 17 '16 11:06 wherget

Cool. Want to open a PR?

trevnorris avatar Jun 21 '16 05:06 trevnorris