OSDN Git Service

ADT: Fix MapVector::erase()
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 15 Jul 2014 18:32:30 +0000 (18:32 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 15 Jul 2014 18:32:30 +0000 (18:32 +0000)
commitd9ebc5991be6fcbaf8231039d7403ff663005fe9
tree900bd520ed39ce6be6267eec4952a9ce6cea0080
parent9f865ed141acd87c8913a5b322f282532b26d5d5
ADT: Fix MapVector::erase()

Actually update the changed indexes in the map portion of `MapVector`
when erasing from the middle.  Add a unit test that checks for this.

Note that `MapVector::erase()` is a linear time operation (it was and
still is).  I'll commit a new method in a moment called
`MapVector::remove_if()` that deletes multiple entries in linear time,
which should be slightly less painful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213084 91177308-0d34-0410-b5e6-96231b3b80d8
docs/ProgrammersManual.rst
include/llvm/ADT/MapVector.h
unittests/ADT/MapVectorTest.cpp