-
Notifications
You must be signed in to change notification settings - Fork 38
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
remove zero-byte restriction in keyvi, to allow search of arbitrary binary data #104
remove zero-byte restriction in keyvi, to allow search of arbitrary binary data #104
Conversation
uint64_t state = fsa_->GetStartState(); | ||
size_t key_length = strlen(key); | ||
size_t key_length = key.size(); |
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.
In general I prefer and have a habit to define variables which are not going to be changed as const
. This improves readability, prevents from some errors and even sometimes can help compiler to generate more efficient code.
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.
👍 changing at least the lines I touched
uint64_t state = fsa_->GetStartState(); | ||
size_t text_length = strlen(key); | ||
size_t text_length = key.size(); |
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.
see above.
@@ -220,7 +218,7 @@ final { | |||
stack_->UpdateWeights(0, input_key.size() + 1, weight); | |||
} | |||
|
|||
last_key_ = key; | |||
last_key_ = std::move(input_key); |
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.
input_key
is a const
, so std::move
call will return const std::string&&
which is not the same as std::string&&
and in the end anyway copy-constructor
will be called as it's a better match, not move
rebased in #115 |
No description provided.