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

Commit 5771a0bc authored by Lajos Molnar's avatar Lajos Molnar
Browse files

stagefright/foundation: fix ALookup for same types

Change-Id: Idc7fc53872de32e57490e694cacd0db469f9fe12
parent ee4804a7
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -29,8 +29,12 @@ struct ALookup {


    bool lookup(const T& from, U *to);
    bool lookup(const T& from, U *to);
    bool rlookup(const U& from, T *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:
private:
    std::vector<std::pair<T, U>> mTable;
    std::vector<std::pair<T, U>> mTable;