You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/12/07 17:04:45 UTC

[GitHub] [arrow] coryan commented on a change in pull request #11842: ARROW-14917: [C++] Implement GcsFileSystem::CreateDir

coryan commented on a change in pull request #11842:
URL: https://github.com/apache/arrow/pull/11842#discussion_r764196790



##########
File path: cpp/src/arrow/filesystem/gcsfs.cc
##########
@@ -332,12 +385,15 @@ class GcsFileSystem::Impl {
   static Result<FileInfo> GetFileInfoImpl(const GcsPath& path,
                                           const google::cloud::Status& status,
                                           FileType type) {
+    const auto& canonical = type == FileType::Directory
+                                ? internal::EnsureTrailingSlash(path.full_path)
+                                : path.full_path;

Review comment:
       Yes, it is ok:
   
   > The lifetime of a temporary object may be extended by binding to a const lvalue reference or to an rvalue reference (since C++11), see reference initialization for details.
   
   https://en.cppreference.com/w/cpp/language/lifetime#:~:text=The%20lifetime%20of%20a%20temporary%20object%20may%20be%20extended%20by%20binding%20to%20a%20const%20lvalue%20reference
   
   https://en.cppreference.com/w/cpp/language/reference_initialization#Lifetime_of_a_temporary
   
   




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org