summaryrefslogtreecommitdiff
path: root/extensions/source
diff options
context:
space:
mode:
authorHossein <hossein@libreoffice.org>2023-09-06 22:50:25 +0200
committerHossein <hossein@libreoffice.org>2023-09-07 10:09:14 +0200
commit7a643f40b4c76bc55f17c3137aad90dbf55463ea (patch)
treeb2b0a9f0242c1a4a12f4a4c1ebf625d4a875ba9a /extensions/source
parent3aa3f0a1638a8d8006955b62bb647526768be3d8 (diff)
Simplify condition in a loop over a single element
The loop was over an array which has only one element, so the condition should also work directly with its only element. Change-Id: I5b87cf03d90e9da67ac3ff72b593be0ff5fa322c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129677 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'extensions/source')
-rw-r--r--extensions/source/activex/SOActionsApproval.cxx13
-rw-r--r--extensions/source/activex/SOComWindowPeer.cxx13
-rw-r--r--extensions/source/activex/SODispatchInterceptor.cxx14
3 files changed, 9 insertions, 31 deletions
diff --git a/extensions/source/activex/SOActionsApproval.cxx b/extensions/source/activex/SOActionsApproval.cxx
index 833e220ae183..6fd6d0888141 100644
--- a/extensions/source/activex/SOActionsApproval.cxx
+++ b/extensions/source/activex/SOActionsApproval.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-// SOActionsApproval.cpp : Implementation of CHelpApp and DLL registration.
+// SOActionsApproval.cxx : Implementation of CHelpApp and DLL registration.
#include <sal/config.h>
@@ -31,15 +31,8 @@
COM_DECLSPEC_NOTHROW STDMETHODIMP SOActionsApproval::InterfaceSupportsErrorInfo(REFIID riid)
{
- static const IID* arr[] = {
- &IID_ISOActionsApproval,
- };
-
- for (std::size_t i = 0; i < SAL_N_ELEMENTS(arr); i++)
- {
- if (InlineIsEqualGUID(*arr[i], riid))
- return S_OK;
- }
+ if (InlineIsEqualGUID(IID_ISOActionsApproval, riid))
+ return S_OK;
return S_FALSE;
}
diff --git a/extensions/source/activex/SOComWindowPeer.cxx b/extensions/source/activex/SOComWindowPeer.cxx
index 6973bc173984..59510c24a7a7 100644
--- a/extensions/source/activex/SOComWindowPeer.cxx
+++ b/extensions/source/activex/SOComWindowPeer.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-// SOComWindowPeer.cpp : Implementation of CHelpApp and DLL registration.
+// SOComWindowPeer.cxx : Implementation of CHelpApp and DLL registration.
#include <sal/config.h>
@@ -30,15 +30,8 @@
COM_DECLSPEC_NOTHROW STDMETHODIMP SOComWindowPeer::InterfaceSupportsErrorInfo(REFIID riid)
{
- static const IID* arr[] = {
- &IID_ISOComWindowPeer,
- };
-
- for (std::size_t i = 0; i < SAL_N_ELEMENTS(arr); i++)
- {
- if (InlineIsEqualGUID(*arr[i], riid))
- return S_OK;
- }
+ if (InlineIsEqualGUID(IID_ISOComWindowPeer, riid))
+ return S_OK;
return S_FALSE;
}
diff --git a/extensions/source/activex/SODispatchInterceptor.cxx b/extensions/source/activex/SODispatchInterceptor.cxx
index af3d69e02ea9..97ea07568fde 100644
--- a/extensions/source/activex/SODispatchInterceptor.cxx
+++ b/extensions/source/activex/SODispatchInterceptor.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-// SODispatchInterceptor.cpp : Implementation of CHelpApp and DLL registration.
+// SODispatchInterceptor.cxx : Implementation of CHelpApp and DLL registration.
#include <sal/config.h>
@@ -33,16 +33,8 @@
COM_DECLSPEC_NOTHROW STDMETHODIMP SODispatchInterceptor::InterfaceSupportsErrorInfo(REFIID riid)
{
- static const IID* arr[] =
- {
- &IID_ISODispatchInterceptor,
- };
-
- for (auto const &i : arr)
- {
- if (InlineIsEqualGUID(*i,riid))
- return S_OK;
- }
+ if (InlineIsEqualGUID(IID_ISODispatchInterceptor, riid))
+ return S_OK;
return S_FALSE;
}