mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 06:21:16 +01:00
[iter] Simplify has() interface implementations
This commit is contained in:
1 parent
cba82829ba
commit
d2a2670e54
6 files changed
+11
-22
No files matched your search
@@ -74,10 +74,8 @@ struct Coverage
|
||||
}
|
||||
|
||||
/* Has interface. */
|
||||
static constexpr unsigned SENTINEL = NOT_COVERED;
|
||||
typedef unsigned int value_t;
|
||||
value_t operator [] (hb_codepoint_t k) const { return get (k); }
|
||||
bool has (hb_codepoint_t k) const { return (*this)[k] != SENTINEL; }
|
||||
unsigned operator [] (hb_codepoint_t k) const { return get (k); }
|
||||
bool has (hb_codepoint_t k) const { return (*this)[k] != NOT_COVERED; }
|
||||
/* Predicate. */
|
||||
bool operator () (hb_codepoint_t k) const { return has (k); }
|
||||
|
||||
|
||||
@@ -123,10 +123,8 @@ struct hb_bit_set_invertible_t
|
||||
bool get (hb_codepoint_t g) const { return s.get (g) ^ inverted; }
|
||||
|
||||
/* Has interface. */
|
||||
static constexpr bool SENTINEL = false;
|
||||
typedef bool value_t;
|
||||
value_t operator [] (hb_codepoint_t k) const { return get (k); }
|
||||
bool has (hb_codepoint_t k) const { return (*this)[k] != SENTINEL; }
|
||||
bool operator [] (hb_codepoint_t k) const { return get (k); }
|
||||
bool has (hb_codepoint_t k) const { return (*this)[k]; }
|
||||
/* Predicate. */
|
||||
bool operator () (hb_codepoint_t k) const { return has (k); }
|
||||
|
||||
|
||||
+2
-4
@@ -330,10 +330,8 @@ struct hb_bit_set_t
|
||||
}
|
||||
|
||||
/* Has interface. */
|
||||
static constexpr bool SENTINEL = false;
|
||||
typedef bool value_t;
|
||||
value_t operator [] (hb_codepoint_t k) const { return get (k); }
|
||||
bool has (hb_codepoint_t k) const { return (*this)[k] != SENTINEL; }
|
||||
bool operator [] (hb_codepoint_t k) const { return get (k); }
|
||||
bool has (hb_codepoint_t k) const { return (*this)[k]; }
|
||||
/* Predicate. */
|
||||
bool operator () (hb_codepoint_t k) const { return has (k); }
|
||||
|
||||
|
||||
+1
-2
@@ -248,8 +248,7 @@ struct hb_hashmap_t
|
||||
void del (const K &key) { set_with_hash (key, hb_hash (key), item_t::default_value (), true); }
|
||||
|
||||
/* Has interface. */
|
||||
typedef const V& value_t;
|
||||
value_t operator [] (K k) const { return get (k); }
|
||||
const V& operator [] (K k) const { return get (k); }
|
||||
template <typename VV=V>
|
||||
bool has (K key, VV **vp = nullptr) const
|
||||
{
|
||||
|
||||
@@ -1999,10 +1999,8 @@ struct ClassDefFormat2_4
|
||||
struct ClassDef
|
||||
{
|
||||
/* Has interface. */
|
||||
static constexpr unsigned SENTINEL = 0;
|
||||
typedef unsigned int value_t;
|
||||
value_t operator [] (hb_codepoint_t k) const { return get (k); }
|
||||
bool has (hb_codepoint_t k) const { return (*this)[k] != SENTINEL; }
|
||||
unsigned operator [] (hb_codepoint_t k) const { return get (k); }
|
||||
bool has (hb_codepoint_t k) const { return (*this)[k]; }
|
||||
/* Projection. */
|
||||
hb_codepoint_t operator () (hb_codepoint_t k) const { return get (k); }
|
||||
|
||||
|
||||
+2
-4
@@ -105,10 +105,8 @@ struct hb_sparseset_t
|
||||
bool get (hb_codepoint_t g) const { return s.get (g); }
|
||||
|
||||
/* Has interface. */
|
||||
static constexpr bool SENTINEL = false;
|
||||
typedef bool value_t;
|
||||
value_t operator [] (hb_codepoint_t k) const { return get (k); }
|
||||
bool has (hb_codepoint_t k) const { return (*this)[k] != SENTINEL; }
|
||||
bool operator [] (hb_codepoint_t k) const { return get (k); }
|
||||
bool has (hb_codepoint_t k) const { return (*this)[k]; }
|
||||
|
||||
/* Predicate. */
|
||||
bool operator () (hb_codepoint_t k) const { return has (k); }
|
||||
|
||||
Reference in new issue
Block a user