adamdebreceni commented on a change in pull request #1083:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1083#discussion_r643114975



##########
File path: extensions/libarchive/MergeContent.h
##########
@@ -80,18 +80,18 @@ class BinaryConcatenationMerge : public MergeBin {
     int64_t process(const std::shared_ptr<io::BaseStream>& stream) {
       int64_t ret = 0;
       if (!header_.empty()) {
-        int64_t len = 
stream->write(reinterpret_cast<uint8_t*>(const_cast<char*>(header_.data())), 
gsl::narrow<int>(header_.size()));
-        if (len < 0)
-          return len;
-        ret += len;
+        const auto write_ret = 
stream->write(reinterpret_cast<uint8_t*>(const_cast<char*>(header_.data())), 
header_.size());
+        if (io::isError(write_ret))
+          return -1;
+        ret += gsl::narrow<int64_t>(write_ret);

Review comment:
       same argument here, we could make `ret` `size_t` (possibly renaming it 
to something more descriptive, like `write_size`) and make do with a single 
narrow at the return




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to