vcl/win/dtrans/ImplHelper.cxx |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit d9435d2759e78b716b64bfccdecaac3f3f1a0e4d
Author:     Simon Chenery <simon_chen...@yahoo.com>
AuthorDate: Sat Mar 29 16:37:16 2025 +0100
Commit:     David Gilbert <freedesk...@treblig.org>
CommitDate: Mon Apr 28 03:04:52 2025 +0200

    tdf#153294 simplify for loop to std::find call in ImplHelper.cxx
    
    Change-Id: I3bf6b955942c0ef5bf6ab4398b1a2f3103a0a133
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183488
    Tested-by: Jenkins
    Reviewed-by: David Gilbert <freedesk...@treblig.org>

diff --git a/vcl/win/dtrans/ImplHelper.cxx b/vcl/win/dtrans/ImplHelper.cxx
index 84c7383b2ce7..c1e541090445 100644
--- a/vcl/win/dtrans/ImplHelper.cxx
+++ b/vcl/win/dtrans/ImplHelper.cxx
@@ -134,16 +134,12 @@ bool IsOEMCP( sal_uInt32 codepage )
 {
     OSL_ASSERT( IsValidCodePage( codepage ) );
 
-    sal_uInt32 arrOEMCP[] = { 437, 708, 709, 710, 720, 737,
+    static constexpr sal_uInt32 arrOEMCP[] = { 437, 708, 709, 710, 720, 737,
                               775, 850, 852, 855, 857, 860,
                               861, 862, 863, 864, 865, 866,
                               869, 874, 932, 936, 949, 950, 1361 };
 
-    for ( size_t i = 0; i < SAL_N_ELEMENTS( arrOEMCP ); ++i )
-        if ( arrOEMCP[i] == codepage )
-            return true;
-
-    return false;
+    return std::find(std::begin(arrOEMCP), std::end(arrOEMCP), codepage) != 
std::end(arrOEMCP);
 }
 
 // converts a codepage into its string representation

Reply via email to