• Nathan Bronson's avatar
    reduce key comparisons in map and set operator== · 11855c21
    Nathan Bronson authored
    Summary:
    The standard requires that operator== for associative containers
    check key equality using operator==, which may be a refinement of the
    container's key_eq.  (The requirement is expressed via equal_range and
    std::is_permutation, but has the same effect.)  The straightforward way to
    implement this results in duplicate key comparisons.  This diff adds a
    containsEqualValue method that can avoid the second check, and uses
    it for map and set operator==.
    
    Reviewed By: yfeldblum
    
    Differential Revision: D16455735
    
    fbshipit-source-id: 8ccd0743f8c11bee5d91c065214cead96dd8b72c
    11855c21
F14Set.h 35.7 KB