Skip to content

Commit 775e7cc

Browse files
committed
[NFC] Change more startswith/endswith to starts_with/ends_with.
My previous PR to change startswith/endswith to starts_with/ends_with was intended to be limited to C++ sources, as we have a number of occurrences in Python files that should be left alone, but I did so by limiting to *.cpp files, when actually we have a few in *.h files that should be updated too.
1 parent a29bb08 commit 775e7cc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

modules/compiler/spirv-ll/include/spirv-ll/builder.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ class Builder {
591591
llvm::SmallVector<llvm::StringRef, 16> subs;
592592
for (size_t nameIndex = 0; nameIndex < names.size(); nameIndex++) {
593593
llvm::StringRef name(names[nameIndex]);
594-
if (name.startswith("Dv")) {
594+
if (name.starts_with("Dv")) {
595595
auto found = std::find(subs.begin(), subs.end(), name);
596596
if (found == subs.end()) {
597597
subs.push_back(name);

modules/compiler/utils/include/compiler/utils/pipeline_parse_helpers.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static bool checkParametrizedPassName(StringRef Name, StringRef PassName) {
7575
if (!Name.consume_front(PassName)) return false;
7676
// normal pass name w/o parameters == default parameters
7777
if (Name.empty()) return true;
78-
return Name.startswith("<") && Name.endswith(">");
78+
return Name.starts_with("<") && Name.ends_with(">");
7979
}
8080

8181
inline Expected<StringRef> parseSinglePassStringRef(StringRef Params) {

0 commit comments

Comments
 (0)