[cfe-dev] [LLVMdev] Bug in MapVector::erase ?

Yaron Keren yaron.keren at gmail.com
Tue Jul 15 13:56:54 PDT 2014


It's worth keeping erase() with the complexity comment, same as we have
linear-time vector find().

All ADT have tradeoffs. We could have constant time erase with a MapList
instead of MapVector but the random access iterator would be linear-time.

Yaron



2014-07-15 23:42 GMT+03:00 Duncan P. N. Exon Smith <dexonsmith at apple.com>:

>
> > On 2014-Jul-15, at 11:28, Duncan P. N. Exon Smith <dexonsmith at apple.com>
> wrote:
> >
> >
> >> On 2014-Jul-15, at 11:07, Reid Kleckner <rnk at google.com> wrote:
> >>
> >> Can we explicitly delete the erase method or do something else to
> document the fact that it is unsupported?  It was added incidentally in
> r211350, even though it was added and removed by Doug back in r175538 /
> r175449.
> >>
> >
> > I'm happy with it deleted or fixed (see WIP patch that fixes it w/o
> > tests).  For now, I'll fix it, and then David (or someone else) can
> > migrate the code to `remove_if()`.
> >
> > FWIW, when it's fixed, it doesn't have to be "unsupported" -- it's
> > just *slow*.
>
> Committed a whitespace change in r213082, fixed `erase()` in r213084, and
> added `remove_if()` in r213090.
>
> I'll leave it up to David how to move forward once the MCDwarf stuff
> migrates to `remove_if()`.
>
> If re-deleting `erase()` is the plan, someone should update the comments
> and the docs right away to say so (I changed the text to document its
> complexity, rather than lack of support).
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140715/83b4952a/attachment.html>


More information about the cfe-dev mailing list