]> granicus.if.org Git - clang/commitdiff
Pass a char instead of a string to the find function. clang-tidy: performance-faster...
authorSylvestre Ledru <sylvestre@debian.org>
Sat, 28 Jan 2017 13:36:34 +0000 (13:36 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Sat, 28 Jan 2017 13:36:34 +0000 (13:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293379 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/Rewrite/RewriteModernObjC.cpp
lib/Frontend/Rewrite/RewriteObjC.cpp

index e7bfcedd217692a661a8d3606bf6caef15613ca9..e6469f53d4657eb8bea2f16cc41b33574d95c6ce 100644 (file)
@@ -4454,7 +4454,7 @@ static void BuildUniqueMethodName(std::string &Name,
   Name += "__" + MD->getSelector().getAsString();
   // Convert colons to underscores.
   std::string::size_type loc = 0;
-  while ((loc = Name.find(":", loc)) != std::string::npos)
+  while ((loc = Name.find(':', loc)) != std::string::npos)
     Name.replace(loc, 1, "_");
 }
 
index e842e592cbbe1bd47a8d1e39a0c8a5d6b18b983f..934d6aa34aa132eabf4f3e993174821519d3fbcc 100644 (file)
@@ -3629,7 +3629,7 @@ static void BuildUniqueMethodName(std::string &Name,
   Name += "__" + MD->getSelector().getAsString();
   // Convert colons to underscores.
   std::string::size_type loc = 0;
-  while ((loc = Name.find(":", loc)) != std::string::npos)
+  while ((loc = Name.find(':', loc)) != std::string::npos)
     Name.replace(loc, 1, "_");
 }