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/06/08 08:22:42 UTC

[GitHub] [nifi-minifi-cpp] martinzink commented on a change in pull request #1028: MINIFICPP-1507 convert InputStream::read to size_t

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



##########
File path: extensions/libarchive/CompressContent.h
##########
@@ -133,28 +134,24 @@ class CompressContent: public core::Processor {
     std::shared_ptr<logging::Logger> logger_;
   };
   // Nest Callback Class for read stream from flow for decompress
-  class ReadCallbackDecompress: public InputStreamCallback {
-  public:
-    ReadCallbackDecompress(const std::shared_ptr<core::FlowFile> &flow) :
-        read_size_(0), offset_(0), flow_(flow) {
-      origin_offset_ = flow_->getOffset();
+  struct ReadCallbackDecompress : InputStreamCallback {
+    explicit ReadCallbackDecompress(std::shared_ptr<core::FlowFile> flow) :
+        flow_file(std::move(flow)) {

Review comment:
       same question

##########
File path: extensions/standard-processors/processors/PutFile.cpp
##########
@@ -304,9 +306,9 @@ void PutFile::getDirectoryPermissions(core::ProcessContext *context) {
 }
 #endif
 
-PutFile::ReadCallback::ReadCallback(const std::string &tmp_file, const std::string &dest_file)
-    : tmp_file_(tmp_file),
-      dest_file_(dest_file) {
+PutFile::ReadCallback::ReadCallback(std::string tmp_file, std::string dest_file)
+    : tmp_file_(std::move(tmp_file)),
+      dest_file_(std::move(dest_file)) {

Review comment:
       same question here

##########
File path: libminifi/include/sitetosite/SiteToSiteClient.h
##########
@@ -43,15 +45,14 @@ namespace sitetosite {
  */
 class DataPacket {
  public:
-  DataPacket(const std::shared_ptr<logging::Logger> &logger, const std::shared_ptr<Transaction> &transaction, std::map<std::string, std::string> attributes, const std::string &payload)
-      : payload_(payload),
-        logger_reference_(logger) {
-    _size = 0;
-    transaction_ = transaction;
-    _attributes = attributes;
+  DataPacket(std::shared_ptr<logging::Logger> logger, std::shared_ptr<Transaction> transaction, std::map<std::string, std::string> attributes, const std::string &payload)
+      : _attributes{std::move(attributes)},
+        transaction_{std::move(transaction)},
+        payload_{payload},
+        logger_reference_{std::move(logger)} {

Review comment:
       why is this better than the const& and copy?




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