You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@orc.apache.org by AnatoliShein <gi...@git.apache.org> on 2017/07/05 15:00:45 UTC

[GitHub] orc pull request #134: Orc 17

Github user AnatoliShein commented on a diff in the pull request:

    https://github.com/apache/orc/pull/134#discussion_r125668140
  
    --- Diff: c++/src/OrcHdfsFile.cc ---
    @@ -66,22 +64,22 @@ namespace orc {
             options = config->GetOptions();
           }
           hdfs::IoService * io_service = hdfs::IoService::New();
    -      //Wrapping fs into a shared pointer to guarantee deletion
    -      std::shared_ptr<hdfs::FileSystem> fs(hdfs::FileSystem::New(io_service, "", options));
    -      if (!fs) {
    +      //Wrapping file_system into a unique pointer to guarantee deletion
    +      file_system = std::unique_ptr<hdfs::FileSystem>(hdfs::FileSystem::New(io_service, "", options));
    +      if (!file_system) {
    --- End diff --
    
    Yes, unique pointer actually supports this notation (thanks to [operator bool](http://en.cppreference.com/w/cpp/memory/unique_ptr/operator_bool))


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---