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



##########
File path: extensions/standard-processors/processors/GenerateFlowFile.h
##########
@@ -67,16 +67,14 @@ class GenerateFlowFile : public core::Processor {
   // Nest Callback Class for write stream
   class WriteCallback : public OutputStreamCallback {
    public:
-    WriteCallback(std::vector<char> && data) : data_(std::move(data)) { // 
NOLINT
-    }
-    WriteCallback(const std::vector<char>& data) : data_(data) { // NOLINT
-    }
-    std::vector<char> data_;
-    int64_t process(const std::shared_ptr<io::BaseStream>& stream) {
-      int64_t ret = 0;
-      if (data_.size() > 0)
-        ret = stream->write(reinterpret_cast<uint8_t*>(&data_[0]), 
gsl::narrow<int>(data_.size()));
-      return ret;
+    explicit WriteCallback(std::vector<char>& data)
+        :data_(&data)
+    { }
+    gsl::not_null<std::vector<char>*> data_;

Review comment:
       why use pointer instead of (const) ref?




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