[set] Speed up intersects()

This commit is contained in:
Behdad Esfahbod 2017-10-15 16:56:05 -04:00
parent 56ef4e0c52
commit 10d43658e7
1 changed files with 2 additions and 6 deletions

View File

@ -238,12 +238,8 @@ struct hb_set_t
inline bool intersects (hb_codepoint_t first, inline bool intersects (hb_codepoint_t first,
hb_codepoint_t last) const hb_codepoint_t last) const
{ {
/* TODO Speedup */ hb_codepoint_t c = first - 1;
unsigned int end = last + 1; return next (&c) && c <= last;
for (hb_codepoint_t i = first; i < end; i++)
if (has (i))
return true;
return false;
} }
inline void set (const hb_set_t *other) inline void set (const hb_set_t *other)
{ {