From ebac56ebb0513e343568a58a0a59163caf8cf57d 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. llvm-svn: 287892 --- clang/lib/Format/Format.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index e1f991a..98565e98 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/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.7.4