Skip to content

Commit

Permalink
Add brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenv committed Apr 9, 2024
1 parent da16720 commit ca62162
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libtiledbsoma/src/soma/soma_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -561,19 +561,22 @@ void SOMAArray::set_metadata(
}

void SOMAArray::delete_metadata(const std::string& key) {
if (key.compare(SOMA_OBJECT_TYPE_KEY) == 0)
if (key.compare(SOMA_OBJECT_TYPE_KEY) == 0) {
throw TileDBSOMAError(SOMA_OBJECT_TYPE_KEY + " cannot be deleted.");
}

if (key.compare(ENCODING_VERSION_KEY) == 0)
if (key.compare(ENCODING_VERSION_KEY) == 0) {
throw TileDBSOMAError(ENCODING_VERSION_KEY + " cannot be deleted.");
}

arr_->delete_metadata(key);
metadata_.erase(key);
}

std::optional<MetadataValue> SOMAArray::get_metadata(const std::string& key) {
if (metadata_.count(key) == 0)
if (metadata_.count(key) == 0) {
return std::nullopt;
}

return metadata_[key];
}
Expand Down

0 comments on commit ca62162

Please sign in to comment.