From 1ac57942ae8d2f37559de543996b2aef2832a1a8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 28 Mar 2023 12:47:26 +0100 Subject: [PATCH] Use range-for loop over wxString in Catch::StringMaker No changes, just simplify the code by using range-for. --- include/wx/catch_cppunit.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/wx/catch_cppunit.h b/include/wx/catch_cppunit.h index f688077bd5..dc8e64024a 100644 --- a/include/wx/catch_cppunit.h +++ b/include/wx/catch_cppunit.h @@ -90,14 +90,12 @@ namespace Catch { std::string s; s.reserve(wxs.length()); - for ( wxString::const_iterator i = wxs.begin(); - i != wxs.end(); - ++i ) + for ( auto c : wxs ) { - if ( !iswprint(*i) ) - s += wxString::Format(wxASCII_STR("\\u%04X"), *i).ToAscii(); + if ( !iswprint(c) ) + s += wxString::Format(wxASCII_STR("\\u%04X"), c).ToAscii(); else - s += *i; + s += c; } return s;