Index: lib/Sema/SemaDeclObjC.cpp =================================================================== --- lib/Sema/SemaDeclObjC.cpp +++ lib/Sema/SemaDeclObjC.cpp @@ -3371,7 +3371,6 @@ SmallVectorImpl &BestMethod, StringRef Typo, const ObjCMethodDecl * Method) { const unsigned MaxEditDistance = 1; - unsigned BestEditDistance = MaxEditDistance + 1; std::string MethodName = Method->getSelector().getAsString(); unsigned MinPossibleEditDistance = abs((int)MethodName.size() - (int)Typo.size()); @@ -3381,12 +3380,8 @@ unsigned EditDistance = Typo.edit_distance(MethodName, true, MaxEditDistance); if (EditDistance > MaxEditDistance) return; - if (EditDistance == BestEditDistance) - BestMethod.push_back(Method); - else if (EditDistance < BestEditDistance) { - BestMethod.clear(); - BestMethod.push_back(Method); - } + BestMethod.clear(); + BestMethod.push_back(Method); } static bool HelperIsMethodInObjCType(Sema &S, Selector Sel,