https://codereview.chromium.org/11775016/diff/1/src/data-flow.h
File src/data-flow.h (right):

https://codereview.chromium.org/11775016/diff/1/src/data-flow.h#newcode229
src/data-flow.h:229: void Union(const GrowableBitVector& other, Zone*
zone) {
On 2013/01/07 15:10:34, Toon Verwaest wrote:
I'd prefer keeping the original AddAll name (in the client of this
method).
Union sounds like it would return a new vector as the union of both
arguments.

I intentionally chose Union, because it is semantically the same as
BitVector::Union, so it is much more important to keep it consistent
with that than with any other collections data structure. All
(Growable)BitVector functions destructively change "this", and as much
as I would like it, I don't remember seeing any persistent/immutable
data structure in v8. :-P

Could possibly EnsureCapacity(other->Length());

Again, I considered this, but this is not necessarily an improvement:
other could have been overallocated, so this would be wasteful. In any
case: Don't optimize unless you have hard numbers, and the gprof profile
tells me that this is definitely not hot.

In any case I agree that there should be some naming/semantic cleanup of
the current collection chaos, but this is intended to be a small
localized CL. :-)

https://codereview.chromium.org/11775016/

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to