-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor the code for index parameter parsing #126
Conversation
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
} else { | ||
common_param.allocator_ = DefaultAllocator::Instance().get(); | ||
if (allocator == nullptr) { | ||
index_common_params.allocator_ = DefaultAllocator::Instance().get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the allocator_
can change to shared_ptr ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The allocator_ may be passed in as a raw pointer from outside.
@@ -24,10 +24,10 @@ | |||
namespace vsag { | |||
class HGraphParameters { | |||
public: | |||
explicit HGraphParameters(const IndexCommonParam& common_param, const std::string& str = ""); | |||
explicit HGraphParameters(JsonType& hgraph_param, const IndexCommonParam& common_param); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep a consistent params sequence style:
explicit HGraphParams(const IndexCommonParam& common_param, JsonType& hgraph_param)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have refactored all the construct function of index to the style like HGraphParameters(JsonType& hgraph_param, const IndexCommonParam& common_param);
to keep the same style with data_cell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
miss commit ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -31,6 +32,6 @@ class IndexCommonParam { | |||
Allocator* allocator_{nullptr}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public fields do not need to end with _
change in next PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.