Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: JaySon-Huang <[email protected]>
  • Loading branch information
JaySon-Huang committed Jan 7, 2025
1 parent 92b36b1 commit e019cfa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions dbms/src/Storages/KVStore/FFI/ProxyFFI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,14 @@ CppStrWithView HandleReadPage(const EngineStoreServerWrap * server, BaseBuffView
{
auto uni_ps = server->tmt->getContext().getWriteNodePageStorage();
RaftDataReader reader(*uni_ps);
auto * page = new Page(reader.read(UniversalPageId(page_id.data, page_id.len)));
if (page->isValid())
auto p = reader.read(UniversalPageId(page_id.data, page_id.len));
if (p.isValid())
{
LOG_TRACE(
&Poco::Logger::get("ProxyFFI"),
"FFI read page {} success",
UniversalPageId(page_id.data, page_id.len));
auto * page = new Page(std::move(p));
return CppStrWithView{
.inner = GenRawCppPtr(page, RawCppPtrTypeImpl::UniversalPage),
.view = BaseBuffView{page->data.begin(), page->data.size()},
Expand Down
4 changes: 2 additions & 2 deletions dbms/src/Storages/Page/Page.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct FieldOffsetInsidePage
bool operator<(const FieldOffsetInsidePage & rhs) const { return index < rhs.index; }
};

struct Page
class Page
{
public:
static Page invalidPage()
Expand All @@ -69,7 +69,7 @@ struct Page
std::set<FieldOffsetInsidePage> field_offsets;

private:
bool is_valid;
bool is_valid = false;

public:
inline bool isValid() const { return is_valid; }
Expand Down

0 comments on commit e019cfa

Please sign in to comment.