summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2025-11-26 13:51:42 +0100
committerMarc Mutz <marc.mutz@qt.io>2025-11-27 12:01:29 +0100
commit11746c54d8402a2ce9c8abea79dc2f08ec7c20c1 (patch)
treeba50df749e6e964eaf8f00f0e79577af99fc3ff6
parent04f9e99163773cfc41e25a49fc648ae6881a69ac (diff)
QSpiMatchRuleMatcher: reduce QList indexing by 32x
Drag the constant out of the loop. The compiler likely won't. Amends 7a478ff96f27fbfc8ddfbc67ba62276580aa02b4. Change-Id: I16bd27c6c77d518933a5509a2f7fafb74c7175ac Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
-rw-r--r--src/gui/accessible/linux/qspimatchrulematcher.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/accessible/linux/qspimatchrulematcher.cpp b/src/gui/accessible/linux/qspimatchrulematcher.cpp
index 1c8f17ac335..2629bad2438 100644
--- a/src/gui/accessible/linux/qspimatchrulematcher.cpp
+++ b/src/gui/accessible/linux/qspimatchrulematcher.cpp
@@ -24,8 +24,9 @@ QSpiMatchRuleMatcher::QSpiMatchRuleMatcher(const QSpiMatchRule &matchRule)
{
// extract roles encoded in bitset stored in multiple 32 bit integers
for (qsizetype i = 0; i < matchRule.roles.size(); ++i) {
+ const auto role = matchRule.roles.at(i);
for (int j = 0; j < 32; j++) {
- if (matchRule.roles.at(i) & (1 << j)) {
+ if (role & (1 << j)) {
const auto atspiRole = i * 32 + j;
if (atspiRole < ATSPI_ROLE_LAST_DEFINED)
m_roles.insert(AtspiRole(atspiRole));