Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4913ca88 authored by Ryan Prichard's avatar Ryan Prichard
Browse files

Remove unnecessary std::unary_function base classes

The function objects work equally well without them, and the base
classes were wrong for both types:
 * HashForEntry: returns size_t but declared to return hash_t
   (uint32_t)
 * EqualityForHashedEntries: returns bool and takes two parameters but
   declared to return hash_t and take one parameter

std::unary_function was deprecated in C++11 and removed in C++17.
Upstream libc++ now removes the type for new-enough C++ dialects.

Bug: http://b/175635923
Test: treehugger
Change-Id: I2ff15c5da6a4e4f71df08c243f8af2f11d8d2b0d
parent 0d78c9a0
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -84,13 +84,13 @@ private:
        const TKey& getKey() const final { return key; }
        const TKey& getKey() const final { return key; }
    };
    };


    struct HashForEntry : public std::unary_function<KeyedEntry*, hash_t> {
    struct HashForEntry {
        size_t operator() (const KeyedEntry* entry) const {
        size_t operator() (const KeyedEntry* entry) const {
            return hash_type(entry->getKey());
            return hash_type(entry->getKey());
        };
        };
    };
    };


    struct EqualityForHashedEntries : public std::unary_function<KeyedEntry*, hash_t> {
    struct EqualityForHashedEntries {
        bool operator() (const KeyedEntry* lhs, const KeyedEntry* rhs) const {
        bool operator() (const KeyedEntry* lhs, const KeyedEntry* rhs) const {
            return lhs->getKey() == rhs->getKey();
            return lhs->getKey() == rhs->getKey();
        };
        };