-
Notifications
You must be signed in to change notification settings - Fork 998
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
chore: Implement list Pop/Erase functionality with QList #4099
Conversation
Adjusted OpRem/OpBPop/OpPop Signed-off-by: Roman Gershman <[email protected]>
@@ -355,6 +355,40 @@ void QList::Push(string_view value, Where where) { | |||
} | |||
} | |||
|
|||
string QList::Pop(Where where) { |
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.
Just to think: we can create our own string_view type (that can contain string_view or short string for 19 symbols) and return it without allocations
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.
You don't need to optimize by space, so it can be just a variant<string, string_view>
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.
we can not return string_view if we pop. in any case it's not urgent and can not be done easily during the transition.
there is no regression here.
if (is_int) { | ||
return entry.is_int() && entry.ival() == ival; | ||
} | ||
return entry == elem; |
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.
return is_int ? entry.is_int() && entry.ival() == ival : entry == elem;
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.
will fix in the subsequent pr
Adjusted OpRem/OpBPop/OpPop