adamdebreceni commented on a change in pull request #1028:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1028#discussion_r601414700
##########
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:
not sure how other `Callback::process` methods work when they encounter
an error, do they generally return what they managed to process or do they
signal an error?
--
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]