llvm.org GIT mirror llvm / bf60ce0
Apply clang-tidy's 'performance-faster-string-find' check to LLVM. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288235 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 2 years ago
5 changed file(s) with 5 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
109109 }
110110
111111 // Replace * with .*
112 for (size_t pos = 0; (pos = Regexp.find("*", pos)) != std::string::npos;
112 for (size_t pos = 0; (pos = Regexp.find('*', pos)) != std::string::npos;
113113 pos += strlen(".*")) {
114114 Regexp.replace(pos, strlen("*"), ".*");
115115 }
202202 thinlto_emit_imports_files = true;
203203 } else if (opt.startswith("thinlto-prefix-replace=")) {
204204 thinlto_prefix_replace = opt.substr(strlen("thinlto-prefix-replace="));
205 if (thinlto_prefix_replace.find(";") == std::string::npos)
205 if (thinlto_prefix_replace.find(';') == std::string::npos)
206206 message(LDPL_FATAL, "thinlto-prefix-replace expects 'old;new' format");
207207 } else if (opt.startswith("cache-dir=")) {
208208 cache_dir = opt.substr(strlen("cache-dir="));
741741
742742 auto ModifiedTime = Status.getLastModificationTime();
743743 std::string ModifiedTimeStr = to_string(ModifiedTime);
744 size_t found = ModifiedTimeStr.rfind(":");
744 size_t found = ModifiedTimeStr.rfind(':');
745745 ViewOpts.CreatedTimeStr = (found != std::string::npos)
746746 ? "Created: " + ModifiedTimeStr.substr(0, found)
747747 : "Created: " + ModifiedTimeStr;
605605
606606 // Add dummy symbols to the memory manager.
607607 for (const auto &Mapping : DummySymbolMappings) {
608 size_t EqualsIdx = Mapping.find_first_of("=");
608 size_t EqualsIdx = Mapping.find_first_of('=');
609609
610610 if (EqualsIdx == StringRef::npos)
611611 report_fatal_error("Invalid dummy symbol specification '" + Mapping +
164164 std::string SubOpName;
165165
166166 // Check to see if this is $foo.bar.
167 std::string::size_type DotIdx = OpName.find_first_of(".");
167 std::string::size_type DotIdx = OpName.find_first_of('.');
168168 if (DotIdx != std::string::npos) {
169169 SubOpName = OpName.substr(DotIdx+1);
170170 if (SubOpName.empty())