szaszm commented on a change in pull request #1028:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1028#discussion_r639708731



##########
File path: extensions/tensorflow/TFExtractTopLabels.cpp
##########
@@ -134,9 +136,9 @@ int64_t 
TFExtractTopLabels::LabelsReadCallback::process(const std::shared_ptr<io
   buf.resize(buf_size);
 
   while (total_read < stream->size()) {
-    auto read = stream->read(reinterpret_cast<uint8_t *>(&buf[0]), 
static_cast<int>(buf_size));
-
-    for (auto i = 0; i < read; i++) {
+    const auto read = stream->read(reinterpret_cast<uint8_t *>(&buf[0]), 
buf_size);
+    if (io::isError(read)) break;

Review comment:
       read/write usually signal an error, but it's not consistent. I think 
Callback::process just forwards these results.




-- 
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:
us...@infra.apache.org


Reply via email to