Skip to content

Commit e411c88

Browse files
Use StringRef::find_first_of(char), etc (NFC) (#92841)
1 parent 312c132 commit e411c88

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

clang/utils/TableGen/ClangDiagnosticsEmitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ Piece *DiagnosticTextBuilder::DiagText::parseDiagText(StringRef &Text,
10861086
PluralPiece *Plural = New<PluralPiece>();
10871087
do {
10881088
Text = Text.drop_front(); // '{' or '|'
1089-
size_t End = Text.find_first_of(":");
1089+
size_t End = Text.find_first_of(':');
10901090
if (End == StringRef::npos)
10911091
Builder.PrintFatalError("expected ':' while parsing %plural");
10921092
++End;

llvm/lib/Support/LockFileManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ LockFileManager::readLockFile(StringRef LockFileName) {
6666
StringRef Hostname;
6767
StringRef PIDStr;
6868
std::tie(Hostname, PIDStr) = getToken(MB.getBuffer(), " ");
69-
PIDStr = PIDStr.substr(PIDStr.find_first_not_of(" "));
69+
PIDStr = PIDStr.substr(PIDStr.find_first_not_of(' '));
7070
int PID;
7171
if (!PIDStr.getAsInteger(10, PID)) {
7272
auto Owner = std::make_pair(std::string(Hostname), PID);

llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,9 @@ void applySpecificSectionMappings(RuntimeDyld &Dyld,
649649
const FileToSectionIDMap &FileToSecIDMap) {
650650

651651
for (StringRef Mapping : SpecificSectionMappings) {
652-
size_t EqualsIdx = Mapping.find_first_of("=");
652+
size_t EqualsIdx = Mapping.find_first_of('=');
653653
std::string SectionIDStr = std::string(Mapping.substr(0, EqualsIdx));
654-
size_t ComaIdx = Mapping.find_first_of(",");
654+
size_t ComaIdx = Mapping.find_first_of(',');
655655

656656
if (ComaIdx == StringRef::npos)
657657
report_fatal_error("Invalid section specification '" + Mapping +

mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ void MLIRDocument::getCodeActionForDiagnostic(
917917
edit.range = lsp::Range(lsp::Position(pos.line, 0));
918918

919919
// Use the indent of the current line for the expected-* diagnostic.
920-
size_t indent = line.find_first_not_of(" ");
920+
size_t indent = line.find_first_not_of(' ');
921921
if (indent == StringRef::npos)
922922
indent = line.size();
923923

0 commit comments

Comments
 (0)