cbuffer
cbuffer copied to clipboard
Semantics of length and size switched?
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?
Cool. Want to open a PR?