Skip to content

Commit 0b6286a

Browse files
committed
1
1 parent 8c076c0 commit 0b6286a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/iceberg/update/update_properties.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Result<PendingUpdate::ApplyResult> UpdateProperties::Apply() {
7474
ICEBERG_RETURN_UNEXPECTED(CheckErrors());
7575
const auto& current_props = transaction_->current().properties.configs();
7676
std::unordered_map<std::string, std::string> new_properties;
77+
std::vector<std::string> removals;
7778
for (const auto& [key, value] : current_props) {
7879
if (!removals_.contains(key)) {
7980
new_properties[key] = value;
@@ -116,15 +117,13 @@ Result<PendingUpdate::ApplyResult> UpdateProperties::Apply() {
116117
result.updates.emplace_back(std::make_unique<table::SetProperties>(updates_));
117118
}
118119
if (!removals_.empty()) {
119-
std::vector<std::string> existing_removals;
120120
for (const auto& key : removals_) {
121121
if (current_props.contains(key)) {
122-
existing_removals.push_back(key);
122+
removals.push_back(key);
123123
}
124124
}
125-
if (!existing_removals.empty()) {
126-
result.updates.emplace_back(
127-
std::make_unique<table::RemoveProperties>(existing_removals));
125+
if (!removals.empty()) {
126+
result.updates.emplace_back(std::make_unique<table::RemoveProperties>(removals));
128127
}
129128
}
130129
if (format_version_.has_value()) {

0 commit comments

Comments
 (0)