Skip to content

[Analysis] Use llvm::erase_if (NFC) #141446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label May 26, 2025
@llvmbot
Copy link
Member

llvmbot commented May 26, 2025

@llvm/pr-subscribers-clang

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/141446.diff

1 Files Affected:

  • (modified) clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp (+1-3)
diff --git a/clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp b/clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp
index 720999207083d..4e97174c17d95 100644
--- a/clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp
+++ b/clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp
@@ -86,9 +86,7 @@ mutatedBy(const SmallVectorImpl<BoundNodes> &Results, ASTUnit *AST) {
 }
 
 std::string removeSpace(std::string s) {
-  s.erase(std::remove_if(s.begin(), s.end(),
-                         [](char c) { return llvm::isSpace(c); }),
-          s.end());
+  llvm::erase_if(s, llvm::isSpace);
   return s;
 }
 

@kazutakahirata kazutakahirata merged commit ecd248f into llvm:main May 26, 2025
13 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250525_llvm_erase_if_clang branch May 26, 2025 16:24
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants