Skip to content

Commit

Permalink
Merge pull request #65 from ecmwf/feature/62-AxisRegistry-Develop
Browse files Browse the repository at this point in the history
Copy DenseSet in IndexAxis.merge
  • Loading branch information
danovaro authored Jan 14, 2025
2 parents 22e9a44 + 55cb18b commit 1336a19
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/fdb5/database/IndexAxis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ void IndexAxis::merge(const fdb5::IndexAxis& other) {

auto it = axis_.find(kv.first);
if (it == axis_.end()) {
axis_.emplace(kv.first, kv.second);
/// @note: Have to make a copy, otherwise we risk modifying cached axes in the AxisRegistry.
axis_.emplace(kv.first, std::make_shared<eckit::DenseSet<std::string>>(*kv.second));
} else {
it->second->merge(*kv.second);
};
Expand Down

0 comments on commit 1336a19

Please sign in to comment.