• Leszek Swirski's avatar
    [utils] Move BitVector's iterator to STL-like interface. · 59ea4881
    Leszek Swirski authored
    Replace the Advance/Done methods on BitVector::Iterator with
    STL-compatible operator overloads, and add begin/end methods to
    BitVector itself, so that BitVectors can be iterated with ranged for
    loops.
    
    As a drive-by cleanup, make GrowableBitVector hold the BitVector by
    value (to avoid needing to allocate one for empty iteration), and remove
    its unused (and inefficient) Union method.
    
    Change-Id: Idcd34e26bfb087e3ec8297b4a769a51bfab4b6e8
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3455803Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
    Commit-Queue: Leszek Swirski <leszeks@chromium.org>
    Auto-Submit: Leszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#79071}
    59ea4881
bit-vector.h 9.87 KB