Skip to content
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

Merged
merged 1 commit into from
Nov 10, 2024
Merged

chore: Implement list Pop/Erase functionality with QList #4099

merged 1 commit into from
Nov 10, 2024

Conversation

romange
Copy link
Collaborator

@romange romange commented Nov 10, 2024

Adjusted OpRem/OpBPop/OpPop

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) {
Copy link
Contributor

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

Copy link
Contributor

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>

Copy link
Collaborator Author

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.

Comment on lines +628 to +631
if (is_int) {
return entry.is_int() && entry.ival() == ival;
}
return entry == elem;
Copy link
Contributor

@BorysTheDev BorysTheDev Nov 10, 2024

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;

Copy link
Collaborator Author

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

@romange romange merged commit 9366c67 into main Nov 10, 2024
12 checks passed
@romange romange deleted the QL4 branch November 10, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants