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

Commit 1042efbe authored by Lajos Molnar's avatar Lajos Molnar Committed by Android (Google) Code Review
Browse files

Merge "stagefright/foundation: fix ALookup for same types" into nyc-dev

parents c8e72cb1 5771a0bc
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -29,8 +29,12 @@ struct ALookup {

    bool lookup(const T& from, U *to);
    bool rlookup(const U& from, T *to);
    inline bool map(const T& from, U *to) { return lookup(from, to); }
    inline bool map(const U& from, T *to) { return rlookup(from, to); }

    template<typename V, typename = typename std::enable_if<!std::is_same<T, V>::value>::type>
    inline bool map(const T& from, V *to) { return lookup(from, to); }

    template<typename V, typename = typename std::enable_if<!std::is_same<T, V>::value>::type>
    inline bool map(const V& from, T *to) { return rlookup(from, to); }

private:
    std::vector<std::pair<T, U>> mTable;