From a73bea69c599787b4cfeac92a3afd00749e00434 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Sep 2018 16:31:31 +0200 Subject: [PATCH] OffsetTo::sanitize() more shuffling --- src/hb-open-type.hh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 2c71f819..76ce55a7 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -273,25 +273,25 @@ struct OffsetTo : Offset inline bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); - if (unlikely (!sanitize_shallow (c, base))) return_trace (false); - const Type &obj = StructAtOffset (base, *this); - return_trace (likely (obj.sanitize (c)) || neuter (c)); + return_trace (sanitize_shallow (c, base) && + (StructAtOffset (base, *this).sanitize (c) || + neuter (c))); } template inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const { TRACE_SANITIZE (this); - if (unlikely (!sanitize_shallow (c, base))) return_trace (false); - const Type &obj = StructAtOffset (base, *this); - return_trace (likely (obj.sanitize (c, user_data)) || neuter (c)); + return_trace (sanitize_shallow (c, base) && + (StructAtOffset (base, *this).sanitize (c, user_data) || + neuter (c))); } template inline bool sanitize (hb_sanitize_context_t *c, const void *base, T1 user_data1, T2 user_data2) const { TRACE_SANITIZE (this); - if (unlikely (!sanitize_shallow (c, base))) return_trace (false); - const Type &obj = StructAtOffset (base, *this); - return_trace (likely (obj.sanitize (c, user_data1, user_data2)) || neuter (c)); + return_trace (sanitize_shallow (c, base) && + (StructAtOffset (base, *this).sanitize (c, user_data1, user_data2) || + neuter (c))); } /* Set the offset to Null */ -- GitLab