Skip to content

Commit 8290a51

Browse files
authored
TSerializedCellVec operator bool (#7981)
1 parent 9935637 commit 8290a51

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

ydb/core/scheme/scheme_tablecell.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,11 @@ class TSerializedCellVec {
555555
return Cells;
556556
}
557557

558+
explicit operator bool() const
559+
{
560+
return !Cells.empty();
561+
}
562+
558563
// read headers, assuming the buf is correct and append additional cells at the end
559564
static bool UnsafeAppendCells(TConstArrayRef<TCell> cells, TString& serializedCellVec);
560565

ydb/core/scheme/scheme_tablecell_ut.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,15 @@ Y_UNIT_TEST_SUITE(Scheme) {
135135
0);
136136

137137
TSerializedCellVec vec3;
138+
UNIT_ASSERT(!vec3);
138139
UNIT_ASSERT(vec3.GetCells().empty());
139140
UNIT_ASSERT(vec3.GetBuffer().empty());
140141

141142
TString buf = vec.GetBuffer();
142143
UNIT_ASSERT(buf.size() > cells.size()*2);
143144
vec3.Parse(buf);
145+
UNIT_ASSERT(vec3);
146+
144147

145148
UNIT_ASSERT_VALUES_EQUAL(CompareTypedCellVectors(vec3.GetCells().data(), cells.data(),
146149
types.data(),

0 commit comments

Comments
 (0)