Skip to content

Commit 0c77bc3

Browse files
petrmikheevcopybara-github
authored andcommitted
Remove DCHECKs for dict.Set(None, value), dict.Set(float{x}, value). Unsupported keys will be silently ignored both in debug and release builds.
Removing DCHECKs seems to be the most consistent solution, given that in databag.cc in some codepaths we already ignore missing keys. PiperOrigin-RevId: 870859805 Change-Id: I6abf97706528c21ed3acb248b17e050dc0c894a5
1 parent aa56acc commit 0c77bc3

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

koladata/internal/dict.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,10 @@ class Dict {
6969
void Set(const T& key, DataItem value) {
7070
if constexpr (std::is_same_v<T, DataItem>) {
7171
if (IsUnsupportedDataItemKeyType(key)) {
72-
DCHECK(false);
7372
return;
7473
}
7574
}
7675
using KeyT = arolla::meta::strip_template_t<DataItem::View, T>;
77-
DCHECK(!IsUnsupportedKeyType<KeyT>());
7876
if constexpr (!IsUnsupportedKeyType<KeyT>()) {
7977
data_[key] = std::move(value);
8078
}
@@ -100,13 +98,11 @@ class Dict {
10098
const DataItem& GetOrAssign(const T& key, ValueT&& value) {
10199
if constexpr (std::is_same_v<T, DataItem>) {
102100
if (IsUnsupportedDataItemKeyType(key)) {
103-
DCHECK(false);
104101
return *empty_item_;
105102
}
106103
}
107104
using KeyT = arolla::meta::strip_template_t<DataItem::View, T>;
108105
if constexpr (IsUnsupportedKeyType<KeyT>()) {
109-
DCHECK(false);
110106
return *empty_item_;
111107
}
112108
if (parent_ == nullptr) {

0 commit comments

Comments
 (0)