[CodeHealth] Use std::string::[starts|ends]_with (#26306)
For cases where the comparison is case sensitive, we should use the methods provided by the common std string types provided since cxx20.
This commit is contained in:
@@ -546,7 +546,7 @@ void APIRequestHelper::URLLoaderHandler::ParseSSE(
|
||||
static constexpr char kDataPrefix[] = "data: {";
|
||||
std::erase_if(stream_data, [](std::string_view item) {
|
||||
DVLOG(3) << "Received chunk: " << item;
|
||||
if (!base::StartsWith(item, kDataPrefix)) {
|
||||
if (!item.starts_with(kDataPrefix)) {
|
||||
// This is useful to log in case an API starts
|
||||
// coming back with unknown data type in some
|
||||
// scenarios.
|
||||
|
||||
Reference in New Issue
Block a user