From: Garret Rieger Date: Wed, 8 May 2019 23:31:52 +0000 (-0700) Subject: Add sink support for hb_hashmap_t and a reverse call to hb_pair_t. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=971020eca7c5d576816b93431607f1e63e9584a4;p=platform%2Fupstream%2FlibHarfBuzzSharp.git Add sink support for hb_hashmap_t and a reverse call to hb_pair_t. --- diff --git a/src/hb-algs.hh b/src/hb-algs.hh index f211242..ca70755 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -217,6 +217,11 @@ struct hb_pair_t hb_pair_t (T1 a, T2 b) : first (a), second (b) {} hb_pair_t (const pair_t& o) : first (o.first), second (o.second) {} + hb_pair_t reverse () const + { + return hb_pair_t (second, first); + } + bool operator == (const pair_t& o) const { return first == o.first && second == o.second; } T1 first; diff --git a/src/hb-map.hh b/src/hb-map.hh index 9dc1788..942a301 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -231,6 +231,10 @@ struct hb_hashmap_t | hb_map (hb_ridentity) ) + /* Sink interface. */ + hb_hashmap_t& operator << (const hb_pair_t& v) + { set (v.first, v.second); return *this; } + protected: unsigned int bucket_for (K key) const