[llvm-commits] [llvm] r152143 - in /llvm/trunk: include/llvm/ADT/SmallPtrSet.h lib/Support/SmallPtrSet.cpp unittests/ADT/SmallPtrSetTest.cpp
Benjamin Kramer
benny.kra at googlemail.com
Wed Mar 7 04:14:19 PST 2012
On 07.03.2012, at 09:34, Duncan Sands <baldrick at free.fr> wrote:
> Hi Benjamin,
>
>> SmallPtrSet: Provide a more efficient implementation of swap than the default triple-copy std::swap.
>>
>> This currently assumes that both sets have the same SmallSize to keep the implementation simple,
>> a limitation that can be lifted if someone cares.
>
> how about adding an assertion that checks that they have the same size.
There is an assert in the "both are small" case. In other cases we
just don't have the small size around in SmallPtrSetImpl.
That being said the swap method on SmallPtrSetImpl is protected, so a
user of the SmallPtrSet class cannot call it in an unsafe way.
- Ben
>
> Ciao, Duncan.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list