From b84738cb8b7beaf427d58aa31d7bc3c7f279713b Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 24 Nov 2016 15:42:29 +0000 Subject: [PATCH] [Format] Avoid copying std::sets and simplify code a bit. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287892 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Format/Format.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index e1f991a9bf..98565e9834 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -1555,9 +1555,9 @@ unsigned getOffsetAfterHeaderGuardsAndComments(StringRef FileName, } bool isDeletedHeader(llvm::StringRef HeaderName, - const std::set HeadersToDelete) { - return HeadersToDelete.find(HeaderName) != HeadersToDelete.end() || - HeadersToDelete.find(HeaderName.trim("\"<>")) != HeadersToDelete.end(); + const std::set &HeadersToDelete) { + return HeadersToDelete.count(HeaderName) || + HeadersToDelete.count(HeaderName.trim("\"<>")); } // FIXME: we also need to insert a '\n' at the end of the code if we have an -- 2.40.0