summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-09-25 21:26:31 +0200
committerLuboš Luňák <l.lunak@collabora.com>2021-09-28 13:46:55 +0200
commit6a1aa5ba0be05258b6375433a071389811efd405 (patch)
tree379de30c5eef7df2c2281ccf488a09235a046a42 /desktop
parent6e060ba9e8c4f34b5ad12908e0c0b5f65c533869 (diff)
do not check a const variable in every lambda invocation
If the variable is false, then every call to the lambda will be false as well, so the entire block may be skipped. Change-Id: I8b61133d246fcfa721145f9d28c55e9afdb06e5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122678 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 267d54492d14..0677c0ccc5e7 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1606,11 +1606,14 @@ void CallbackFlushHandler::queue(const int type, const char* data)
const bool hyperLinkException = type == LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR &&
payload.find("\"hyperlink\":\"\"") == std::string::npos &&
payload.find("\"hyperlink\": {}") == std::string::npos;
- const int nViewId = lcl_getViewId(payload);
- removeAll(type, [nViewId, hyperLinkException] (const CallbackData& elemData) {
- return (nViewId == lcl_getViewId(elemData) && !hyperLinkException);
- }
- );
+ if(!hyperLinkException)
+ {
+ const int nViewId = lcl_getViewId(payload);
+ removeAll(type, [nViewId] (const CallbackData& elemData) {
+ return (nViewId == lcl_getViewId(elemData));
+ }
+ );
+ }
}
break;