Commit 33b546b9 authored by Tomaz  Canabrava's avatar Tomaz Canabrava
Browse files

speed up `canBeGrouped`

Move the quick test before the expensive test.
parent f7c07135
......@@ -158,11 +158,15 @@ public:
inline bool canBeGrouped(bool bidirectionalEnabled, bool isDoubleWidth) const
{
if (character <= 0x7e) {
return true;
}
if (QChar::script(character) == QChar::Script_Braille) {
return false;
}
return character <= 0x7e || (rendition & RE_EXTENDED_CHAR) || (bidirectionalEnabled && !isDoubleWidth);
return (rendition & RE_EXTENDED_CHAR) || (bidirectionalEnabled && !isDoubleWidth);
}
inline uint baseCodePoint() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment