aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorazevaykin <145343289+azevaykin@users.noreply.github.com>2024-08-19 15:33:45 +0300
committerGitHub <noreply@github.com>2024-08-19 15:33:45 +0300
commit8290a51b951231a788210e579bdc7a01e8d449ee (patch)
tree3dce89b628e0f3ae407f0e92a2f092b1c53d1526
parent9935637427d8d5949d3f2e1a1025dede1a8076b6 (diff)
downloadydb-8290a51b951231a788210e579bdc7a01e8d449ee.tar.gz
TSerializedCellVec operator bool (#7981)
-rw-r--r--ydb/core/scheme/scheme_tablecell.h5
-rw-r--r--ydb/core/scheme/scheme_tablecell_ut.cpp3
2 files changed, 8 insertions, 0 deletions
diff --git a/ydb/core/scheme/scheme_tablecell.h b/ydb/core/scheme/scheme_tablecell.h
index 5ce8d5515cc..11e8967555b 100644
--- a/ydb/core/scheme/scheme_tablecell.h
+++ b/ydb/core/scheme/scheme_tablecell.h
@@ -555,6 +555,11 @@ public:
return Cells;
}
+ explicit operator bool() const
+ {
+ return !Cells.empty();
+ }
+
// read headers, assuming the buf is correct and append additional cells at the end
static bool UnsafeAppendCells(TConstArrayRef<TCell> cells, TString& serializedCellVec);
diff --git a/ydb/core/scheme/scheme_tablecell_ut.cpp b/ydb/core/scheme/scheme_tablecell_ut.cpp
index e842cf5268e..ee5da9eb4fd 100644
--- a/ydb/core/scheme/scheme_tablecell_ut.cpp
+++ b/ydb/core/scheme/scheme_tablecell_ut.cpp
@@ -135,12 +135,15 @@ Y_UNIT_TEST_SUITE(Scheme) {
0);
TSerializedCellVec vec3;
+ UNIT_ASSERT(!vec3);
UNIT_ASSERT(vec3.GetCells().empty());
UNIT_ASSERT(vec3.GetBuffer().empty());
TString buf = vec.GetBuffer();
UNIT_ASSERT(buf.size() > cells.size()*2);
vec3.Parse(buf);
+ UNIT_ASSERT(vec3);
+
UNIT_ASSERT_VALUES_EQUAL(CompareTypedCellVectors(vec3.GetCells().data(), cells.data(),
types.data(),