-
Notifications
You must be signed in to change notification settings - Fork 882
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
[CodeHealth][wallet] Migrate more utils to string_view
#26688
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
supermassive
approved these changes
Nov 22, 2024
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.
wallet core lgtm
cdesouza-chromium
force-pushed
the
migrate-wallet-utils-to-string-view
branch
from
November 22, 2024 09:46
4bd17e8
to
73486bb
Compare
Making string view more common will permit us to use more compile time `constexpr` globals in the application, as strings are passed around as compile time constants. Resolves brave/brave-browser#42445
cdesouza-chromium
force-pushed
the
migrate-wallet-utils-to-string-view
branch
from
November 22, 2024 10:29
73486bb
to
df36889
Compare
Force-merged due to a failed CI status update on iOS, which passed |
cdesouza-chromium
added a commit
that referenced
this pull request
Nov 22, 2024
This function has been returning a vector of strings, to be used by `GetMany`, and therefore a `NoDestructor` instance is needed. However, the only reason why this has to be a vector of strings is because in the end `EncodeStringArray` requires a vector of strings. This PR changes `EncodeStringArray` to take spans of strings and of string views. This will allows to convert the keys into a `constexpr` value, and avoid the use of `NoDestructor`. In a follow up PR, additional callsites of `EncodeStringArray` may be migrated to the `string_view` variant. This is a follow up of these PRs: #26683 #26688 Resolves brave/brave-browser#42453
24 tasks
cdesouza-chromium
added a commit
that referenced
this pull request
Nov 22, 2024
This function has been returning a vector of strings, to be used by `GetMany`, and therefore a `NoDestructor` instance is needed. However, the only reason why this has to be a vector of strings is because in the end `EncodeStringArray` requires a vector of strings. This PR changes `EncodeStringArray` to take spans of strings and of string views. This will allows to convert the keys into a `constexpr` value, and avoid the use of `NoDestructor`. In a follow up PR, additional callsites of `EncodeStringArray` may be migrated to the `string_view` variant. This is a follow up of these PRs: #26683 #26688 Resolves brave/brave-browser#42453
Released in v1.75.45 |
cdesouza-chromium
added a commit
that referenced
this pull request
Nov 23, 2024
This function has been returning a vector of strings, to be used by `GetMany`, and therefore a `NoDestructor` instance is needed. However, the only reason why this has to be a vector of strings is because in the end `EncodeStringArray` requires a vector of strings. This PR changes `EncodeStringArray` to take spans of strings and of string views. This will allows to convert the keys into a `constexpr` value, and avoid the use of `NoDestructor`. In a follow up PR, additional callsites of `EncodeStringArray` may be migrated to the `string_view` variant. This is a follow up of these PRs: #26683 #26688 Resolves brave/brave-browser#42453
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Making string view more common will permit us to use more compile time
constexpr
globals in the application, as strings are passed around as compile time constants.This is a follow up of #26683
Resolves brave/brave-browser#42445
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: