Skip to content

Commit

Permalink
reuse deduplication logic for direct registration
Browse files Browse the repository at this point in the history
  • Loading branch information
bkietz committed Apr 30, 2024
1 parent e22197f commit 6b5e52b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/src/arrow/filesystem/filesystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,8 @@ class FileSystemFactoryRegistry {
RETURN_NOT_OK(CheckValid());

auto [it, success] = scheme_to_factory_.emplace(
std::move(scheme), Registered{std::move(factory), std::move(finalizer)});
if (success) {
std::move(scheme), Registered{factory, std::move(finalizer)});
if (success || (it->second.ok() && it->second->factory == factory)) {
return Status::OK();
}

Expand Down

0 comments on commit 6b5e52b

Please sign in to comment.