You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/06/13 17:10:35 UTC

[GitHub] [nifi-minifi-cpp] fgerlits commented on a diff in pull request #1348: MINIFICPP-1833 - Integrate misc and modernize clang-tidy checks in CI

fgerlits commented on code in PR #1348:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1348#discussion_r895944533


##########
libminifi/src/utils/Id.cpp:
##########
@@ -193,8 +189,8 @@ IdGenerator::~IdGenerator() = default;
 
 uint64_t IdGenerator::getDeviceSegmentFromString(const std::string& str, int numBits) const {
   uint64_t deviceSegment = 0;
-  for (size_t i = 0; i < str.length(); i++) {
-    unsigned char c = toupper(str[i]);
+  for (auto ch : str) {
+    unsigned char c = toupper(ch);

Review Comment:
   The argument of `toupper` needs to fit into an `unsigned char`.  We have `static_cast<unsigned char>` elsewhere, but a `gsl::narrow` may be better.



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org