[clang-tools-extra] 86436a4 - [clang-tidy][NFC] Made Globlist::contains const

Nathan James via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 8 14:27:09 PST 2020


Author: Nathan James
Date: 2020-12-08T22:26:55Z
New Revision: 86436a4343628f0f98d72169a013cf99a3be5973

URL: https://github.com/llvm/llvm-project/commit/86436a4343628f0f98d72169a013cf99a3be5973
DIFF: https://github.com/llvm/llvm-project/commit/86436a4343628f0f98d72169a013cf99a3be5973.diff

LOG: [clang-tidy][NFC] Made Globlist::contains const

Added: 
    

Modified: 
    clang-tools-extra/clang-tidy/GlobList.cpp
    clang-tools-extra/clang-tidy/GlobList.h

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/GlobList.cpp b/clang-tools-extra/clang-tidy/GlobList.cpp
index 88e6ea22d675..5b70b8d8c577 100644
--- a/clang-tools-extra/clang-tidy/GlobList.cpp
+++ b/clang-tools-extra/clang-tidy/GlobList.cpp
@@ -52,7 +52,7 @@ GlobList::GlobList(StringRef Globs) {
   } while (!Globs.empty());
 }
 
-bool GlobList::contains(StringRef S) {
+bool GlobList::contains(StringRef S) const {
   // Iterating the container backwards as the last match determins if S is in
   // the list.
   for (const GlobListItem &Item : llvm::reverse(Items)) {

diff  --git a/clang-tools-extra/clang-tidy/GlobList.h b/clang-tools-extra/clang-tidy/GlobList.h
index 5acb6a5b878c..fe68a3497c92 100644
--- a/clang-tools-extra/clang-tidy/GlobList.h
+++ b/clang-tools-extra/clang-tidy/GlobList.h
@@ -33,7 +33,7 @@ class GlobList {
 
   /// Returns \c true if the pattern matches \p S. The result is the last
   /// matching glob's Positive flag.
-  bool contains(StringRef S);
+  bool contains(StringRef S) const;
 
 private:
 


        


More information about the cfe-commits mailing list