swebb2066 commented on code in PR #635:
URL: https://github.com/apache/logging-log4cxx/pull/635#discussion_r3136264065
##########
src/main/cpp/stringhelper.cpp:
##########
@@ -24,24 +24,33 @@
#include <iterator>
#include <algorithm>
#include <cctype>
+#include <string>
using namespace LOG4CXX_NS;
using namespace LOG4CXX_NS::helpers;
bool StringHelper::equalsIgnoreCase(const LogString& s1, const logchar* upper,
const logchar* lower)
{
- for (const auto& item : s1)
+ const size_t len_upper = std::char_traits<logchar>::length(upper);
Review Comment:
I still do not see how indexing is better than pointer increments.
Also, I believe the length check ( which is redundent) is less clear than
the in-loop test for a 0 item.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]