[llvm-branch-commits] [clang-tools-extra] 0f9908a - [clangd] Use empty() instead of size()>0

Utkarsh Saxena via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Jan 17 06:25:07 PST 2021


Author: Utkarsh Saxena
Date: 2021-01-17T15:13:01+01:00
New Revision: 0f9908a7c9c547f2675e00f88cc11ec02ca28e8d

URL: https://github.com/llvm/llvm-project/commit/0f9908a7c9c547f2675e00f88cc11ec02ca28e8d
DIFF: https://github.com/llvm/llvm-project/commit/0f9908a7c9c547f2675e00f88cc11ec02ca28e8d.diff

LOG: [clangd] Use empty() instead of size()>0

Added: 
    

Modified: 
    clang-tools-extra/clangd/Quality.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/Quality.cpp b/clang-tools-extra/clangd/Quality.cpp
index 7b6a76584778..f076b44f5743 100644
--- a/clang-tools-extra/clangd/Quality.cpp
+++ b/clang-tools-extra/clangd/Quality.cpp
@@ -512,7 +512,7 @@ evaluateDecisionForest(const SymbolQualitySignals &Quality,
   E.setIsNameInContext(NumMatch > 0);
   E.setNumNameInContext(NumMatch);
   E.setFractionNameInContext(
-      Relevance.ContextWords && Relevance.ContextWords->size() > 0
+      Relevance.ContextWords && Relevance.ContextWords->empty()
           ? NumMatch * 1.0 / Relevance.ContextWords->size()
           : 0);
   E.setIsInBaseClass(Relevance.InBaseClass);


        


More information about the llvm-branch-commits mailing list