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 2021/05/26 13:09:04 UTC
[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #1028: MINIFICPP-1507 convert InputStream::read to size_t
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:
users@infra.apache.org