Skip to content

Commit 03d51ea

Browse files
committed
1
1 parent 9d0bfa3 commit 03d51ea

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/iceberg/catalog/rest/validator.cc

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <format>
2323
#include <ranges>
2424
#include <unordered_set>
25+
#include <utility>
2526

2627
#include "iceberg/catalog/rest/types.h"
2728
#include "iceberg/result.h"
@@ -69,20 +70,23 @@ Status Validator::Validate(const UpdateNamespacePropertiesRequest& request) {
6970
return {};
7071
}
7172

72-
std::unordered_set<std::string> remove_set(std::from_range, request.removals);
73+
std::unordered_set<std::string> remove_set(request.removals.begin(),
74+
request.removals.end());
75+
std::vector<std::string> common;
7376

74-
auto common =
75-
request.updates | std::views::keys |
76-
std::views::filter([&](const std::string& k) { return remove_set.contains(k); }) |
77-
std::ranges::to<std::vector<std::string>>();
77+
for (const std::string& k : request.updates | std::views::keys) {
78+
if (remove_set.contains(k)) {
79+
common.push_back(k);
80+
}
81+
}
7882

7983
if (!common.empty()) {
8084
std::string keys;
8185
bool first = true;
82-
std::ranges::for_each(common, [&](const std::string& s) {
86+
for (const std::string& s : common) {
8387
if (!std::exchange(first, false)) keys += ", ";
8488
keys += s;
85-
});
89+
}
8690

8791
return Invalid(
8892
"Invalid namespace properties update: cannot simultaneously set and remove keys: "

0 commit comments

Comments
 (0)