• Jan Wilken Dörrie's avatar
    [base] Reduce string copies in HistogramTester · 25c0e682
    Jan Wilken Dörrie authored
    This change reduces string copies in base::HistogramTester by changing
    its APIs to take base::StringPieces instead of const std::string&. The
    majority of callsites pass string literals to the HistogramTester APIs,
    resulting in a deep copy with the old implementation.
    
    Furthermore, this change updates the underlying std::maps to use the
    heterogeneous std::less<> comparator, allowing the direct comparison of
    base::StringPiece with std::string.
    
    Bug: 384011
    Change-Id: I6a8dd3e76280162b6046eac63a3d1ac84ed2ee6b
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1887612Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
    Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#710454}
    25c0e682
histogram_tester.h 7.5 KB