Add support for three more string_view functions
- starts_with(char)
- ends_with(char)
- find_first_of(char, size_t)
Reimplemented trim in terms of the new starts_with and ends_with.
Tested:
New unit tests.
Paths
| Differential D129618
Add support for three more string_view functions ClosedPublic Authored by jeffbailey on Jul 12 2022, 11:02 PM.
Details
Summary Add support for three more string_view functions
Reimplemented trim in terms of the new starts_with and ends_with. Tested:
Diff Detail
Event TimelineHerald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 12 2022, 11:02 PM
jeffbailey retitled this revision from Add support for two more string_view functions to Add support for three more string_view functions.Jul 13 2022, 10:43 PM jeffbailey marked 3 inline comments as done. Comment ActionsPTAL This revision is now accepted and ready to land.Jul 14 2022, 1:10 AM Closed by commit rG897b80147d7e: Add support for three more string_view functions (authored by jeffbailey). · Explain WhyJul 14 2022, 7:20 AM This revision was automatically updated to reflect the committed changes. Comment Actions Suggestion for next time: When the patch touches only the libc directory, we should prefix the subject line with [libc] . Sorry for not noticing it on this patch. Comment Actions
Will do. Is there any way to add that in a presubmit? That seems like something that might be difficult to remember as we scale.
Revision Contents
Diff 444652 libc/src/__support/CPP/StringView.h
libc/test/src/__support/CPP/stringview_test.cpp
|
once we have starts_with and ends_with this can be rewritten as: