inline bool operator != (const IntType<Type> &o) const { return v != o.v; }
inline bool sanitize (hb_sanitize_context_t *context) {
TRACE_SANITIZE ();
- return context->check_struct (this);
+ return likely (context->check_struct (this));
}
protected:
BEInt<Type, sizeof (Type)> v;
inline bool sanitize (hb_sanitize_context_t *context, void *base) {
TRACE_SANITIZE ();
- if (!context->check_struct (this)) return false;
+ if (unlikely (!context->check_struct (this))) return false;
unsigned int offset = *this;
if (unlikely (!offset)) return true;
Type &obj = StructAtOffset<Type> (base, offset);
template <typename T>
inline bool sanitize (hb_sanitize_context_t *context, void *base, T user_data) {
TRACE_SANITIZE ();
- if (!context->check_struct (this)) return false;
+ if (unlikely (!context->check_struct (this))) return false;
unsigned int offset = *this;
if (unlikely (!offset)) return true;
Type &obj = StructAtOffset<Type> (base, offset);
inline bool sanitize (hb_sanitize_context_t *context) {
TRACE_SANITIZE ();
- if (!likely (sanitize_shallow (context))) return false;
+ if (unlikely (!sanitize_shallow (context))) return false;
/* Note: for structs that do not reference other structs,
* we do not need to call their sanitize() as we already did
* a bound check on the aggregate array size, hence the return.
}
inline bool sanitize (hb_sanitize_context_t *context, void *base) {
TRACE_SANITIZE ();
- if (!likely (sanitize_shallow (context))) return false;
+ if (unlikely (!sanitize_shallow (context))) return false;
unsigned int count = len;
for (unsigned int i = 0; i < count; i++)
- if (!array[i].sanitize (context, base))
+ if (unlikely (!array[i].sanitize (context, base)))
return false;
return true;
}
template <typename T>
inline bool sanitize (hb_sanitize_context_t *context, void *base, T user_data) {
TRACE_SANITIZE ();
- if (!likely (sanitize_shallow (context))) return false;
+ if (unlikely (!sanitize_shallow (context))) return false;
unsigned int count = len;
for (unsigned int i = 0; i < count; i++)
- if (!array[i].sanitize (context, base, user_data))
+ if (unlikely (!array[i].sanitize (context, base, user_data)))
return false;
return true;
}
inline bool sanitize (hb_sanitize_context_t *context) {
TRACE_SANITIZE ();
- if (!likely (sanitize_shallow (context))) return false;
+ if (unlikely (!sanitize_shallow (context))) return false;
/* Note: for structs that do not reference other structs,
* we do not need to call their sanitize() as we already did
* a bound check on the aggregate array size, hence the return.
unsigned int count = len ? len - 1 : 0;
Type *a = array;
for (unsigned int i = 0; i < count; i++)
- if (!a[i].sanitize (context))
+ if (unlikely (!a[i].sanitize (context)))
return false;
return true;
}