Skip to content
  • Stephen Kelly's avatar
    cmRemoveDuplicates: Store unique iterators instead of values. · 7cbafa8c
    Stephen Kelly authored
    
    
    There is no need to copy all of the values in the container in
    order to determine uniqueness.  Iterators can be stored instead
    and can be used with standard algorithms with custom comparison
    methods.
    
    This also means that we use less space in case the value_type size
    is greater than sizeof(iterator).  That is common for std::string
    which may require up to 32 bytes (libstdc++ 5.0 and MSVC at least).
    With libstdc++ 4.9 and older, std::string is 8 bytes, so we likely
    don't gain anything here.
    
    Inspired-by: default avatarDaniel Pfeifer <daniel@pfeifer-mail.de>
    7cbafa8c