By adding a single mask, we can avoid some unnecessary work, as that
work is not necessary if just the one bit is set.
/* Here, we have found all the possible problems, except for when the input
* is for a problematic code point not allowed by the input parameters. */
- /* isn't problematic if < this */
- if ( ( ( LIKELY(! possible_problems) && uv >= UNICODE_SURROGATE_FIRST)
+ /* uv is valid for overlongs */
+ if ( ( ( LIKELY(! (possible_problems & ~UTF8_GOT_LONG))
+
+ /* isn't problematic if < this */
+ && uv >= UNICODE_SURROGATE_FIRST)
|| ( UNLIKELY(possible_problems)
/* if overflow, we know without looking further