From 7245e35280350f08455ea01244c40c3f96d32ebc Mon Sep 17 00:00:00 2001 From: azevaykin Date: Tue, 14 May 2024 10:51:31 +0000 Subject: [PATCH] CalculateKeyBytes fix --- ydb/core/tx/datashard/datashard_user_db.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ydb/core/tx/datashard/datashard_user_db.cpp b/ydb/core/tx/datashard/datashard_user_db.cpp index ace315979ec8..4f711124043f 100644 --- a/ydb/core/tx/datashard/datashard_user_db.cpp +++ b/ydb/core/tx/datashard/datashard_user_db.cpp @@ -49,11 +49,17 @@ NTable::EReady TDataShardUserDb::SelectRow( } ui64 CalculateKeyBytes(const TArrayRef key) { - return std::accumulate(key.begin(), key.end(), 0, [](ui64 bytes, const TRawTypeValue& value) { return bytes + value.IsEmpty() ? 1 : value.Size(); }); + ui64 bytes = 0ull; + for (const TRawTypeValue& value : key) + bytes += value.IsEmpty() ? 1ull : value.Size(); + return bytes; }; ui64 CalculateValueBytes(const TArrayRef ops) { - return std::accumulate(ops.begin(), ops.end(), 0, [](ui64 bytes, const NIceDb::TUpdateOp& op) { return bytes + op.Value.IsEmpty() ? 1 : op.Value.Size(); }); + ui64 bytes = 0ull; + for (const NIceDb::TUpdateOp& op : ops) + bytes += op.Value.IsEmpty() ? 1ull : op.Value.Size(); + return bytes; }; void TDataShardUserDb::UpdateRow(