From bc27f3573d61012771aa3fee2427f0dd5b8a1288 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 14 Jan 2024 12:17:52 -0800 Subject: [PATCH] [clang-tidy] Use StringRef::consume_front (NFC) --- clang-tools-extra/clang-tidy/GlobList.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/clang-tools-extra/clang-tidy/GlobList.cpp b/clang-tools-extra/clang-tidy/GlobList.cpp index 694db35106fd..dfe3f7c505b1 100644 --- a/clang-tools-extra/clang-tidy/GlobList.cpp +++ b/clang-tools-extra/clang-tidy/GlobList.cpp @@ -16,11 +16,7 @@ namespace clang::tidy { // from the GlobList. static bool consumeNegativeIndicator(StringRef &GlobList) { GlobList = GlobList.trim(); - if (GlobList.starts_with("-")) { - GlobList = GlobList.substr(1); - return true; - } - return false; + return GlobList.consume_front("-"); } // Converts first glob from the comma-separated list of globs to Regex and -- 2.11.4.GIT