Skip to content

Commit

Permalink
fix utl::get_or_create errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pablohoch committed May 24, 2022
1 parent 1542dd9 commit a535e00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions base/loader/src/timezone_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ timezone_name_idx tz_cache::lookup_name(std::string_view timezone_name) {
} else {
prev_name_ = timezone_name;
return prev_name_idx_ =
utl::get_or_create(timezone_name_idx_, timezone_name,
[&]() { return timezone_name_idx_.size(); });
utl::get_or_create(timezone_name_idx_, timezone_name, [&]() {
return static_cast<timezone_name_idx>(
timezone_name_idx_.size());
});
}
}

Expand Down
6 changes: 4 additions & 2 deletions libs/path/src/path_database_query.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,12 @@ void path_database_query::resolve_sequences_and_build_subqueries(

for (auto j = 0ULL; j < segment->hints_rle()->Get(i + 1); ++j) {
auto feature_id = segment->features()->Get(k);
auto const abs_feature_id =
static_cast<uint64_t>(std::abs(feature_id));
auto* resolvable =
utl::get_or_create(subquery.map_, std::abs(feature_id), [&] {
utl::get_or_create(subquery.map_, abs_feature_id, [&] {
auto r = std::make_unique<resolvable_feature>();
r->feature_id_ = std::abs(feature_id);
r->feature_id_ = abs_feature_id;
return subquery.mem_.emplace_back(std::move(r)).get();
});

Expand Down

0 comments on commit a535e00

Please # to comment.