Skip to content

Commit 3e0e77e

Browse files
authored
CalculateKeyBytes operator precedence fix (#4496)
1 parent c0815af commit 3e0e77e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ydb/core/tx/datashard/datashard_user_db.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,17 @@ NTable::EReady TDataShardUserDb::SelectRow(
4949
}
5050

5151
ui64 CalculateKeyBytes(const TArrayRef<const TRawTypeValue> key) {
52-
return std::accumulate(key.begin(), key.end(), 0, [](ui64 bytes, const TRawTypeValue& value) { return bytes + value.IsEmpty() ? 1 : value.Size(); });
52+
ui64 bytes = 0ull;
53+
for (const TRawTypeValue& value : key)
54+
bytes += value.IsEmpty() ? 1ull : value.Size();
55+
return bytes;
5356
};
5457

5558
ui64 CalculateValueBytes(const TArrayRef<const NIceDb::TUpdateOp> ops) {
56-
return std::accumulate(ops.begin(), ops.end(), 0, [](ui64 bytes, const NIceDb::TUpdateOp& op) { return bytes + op.Value.IsEmpty() ? 1 : op.Value.Size(); });
59+
ui64 bytes = 0ull;
60+
for (const NIceDb::TUpdateOp& op : ops)
61+
bytes += op.Value.IsEmpty() ? 1ull : op.Value.Size();
62+
return bytes;
5763
};
5864

5965
void TDataShardUserDb::UpdateRow(

0 commit comments

Comments
 (0)