diff options
author | Robin Burchell <robin.burchell@viroteck.net> | 2014-09-04 12:32:38 +0200 |
---|---|---|
committer | Robin Burchell <robin.burchell@viroteck.net> | 2014-09-15 17:21:11 +0200 |
commit | 46b2c74eaf95fc607518988c7958574c7f70f5ae (patch) | |
tree | 34ad17b9a86df09678a8787ea3231f92b0de6467 /src/widgets/styles/qwindowsstyle.cpp | |
parent | 1c4786389d0adb252e2c61e62652e38c8189c889 (diff) |
QFontDatabase: Micro-optimize getFontWeight.
Translation is an expensive thing, and probably quite uncommon - so don't
penalise any common cases by checking for it until we're quite sure they have
failed.
In addition, we avoid repeated string construction when translating (caching the
result) and avoid repeated case-insensitive comparison by toLowering the string
data.
This change either speeds up most runtime cases that were unfairly penalised
(such as "light") by 50-70% or doesn't impact the runtime speed at all (or,
results were within the margin-of-error).
Of course, calling with translated content will be a bit slower now, but the
slowness of the translations should more than dwarf the real change there.
Change-Id: If24685dfd553e4aed07fbf07678b2585e22b0a3a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/widgets/styles/qwindowsstyle.cpp')
0 files changed, 0 insertions, 0 deletions