felipecrv commented on code in PR #40119:
URL: https://github.com/apache/arrow/pull/40119#discussion_r1496750001
##########
cpp/src/arrow/filesystem/azurefs.cc:
##########
@@ -716,17 +738,31 @@ class ObjectAppendStream final : public io::OutputStream {
io::internal::CloseFromDestructor(this);
}
- Status Init() {
- if (content_length_ != kNoSize) {
- DCHECK_GE(content_length_, 0);
- pos_ = content_length_;
+ Status Init(const bool truncate,
+ std::function<Status()> ensure_not_flat_namespace_directory) {
Review Comment:
> Also if you wouldn't mind I would be interested to know what the
disadvantage of a lambda function is compared to what you proposed.
To create the `std::function`, you heap allocate an object with copies of
the values in the capture list and generate a lot more extra code in the binary:
```
class function {
T valuesfromthecpapturelist;
RetType operator()(ArgsType ...) {...};
}
```
When you think about an `std::function` this way (a pair of context data and
a function), you realize the class you already serves that purpose.
But hey, this is becoming challenging, so I won't hold the PR anymore
because of this. Moving to `Init()` was a big step in the right direction.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]