summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/clangd/Quality.cpp5
-rw-r--r--clang-tools-extra/unittests/clangd/QualityTests.cpp2
2 files changed, 4 insertions, 3 deletions
diff --git a/clang-tools-extra/clangd/Quality.cpp b/clang-tools-extra/clangd/Quality.cpp
index 6a329fbe068..3e3103ff2e3 100644
--- a/clang-tools-extra/clangd/Quality.cpp
+++ b/clang-tools-extra/clangd/Quality.cpp
@@ -7,6 +7,7 @@
//
//===---------------------------------------------------------------------===//
#include "Quality.h"
+#include <cmath>
#include "URI.h"
#include "index/Index.h"
#include "clang/AST/ASTContext.h"
@@ -147,8 +148,8 @@ float SymbolQualitySignals::evaluate() const {
// This avoids a sharp gradient for tail symbols, and also neatly avoids the
// question of whether 0 references means a bad symbol or missing data.
- if (References >= 3)
- Score *= std::log(References);
+ if (References >= 10)
+ Score *= std::log10(References);
if (Deprecated)
Score *= 0.1f;
diff --git a/clang-tools-extra/unittests/clangd/QualityTests.cpp b/clang-tools-extra/unittests/clangd/QualityTests.cpp
index 51ebf5cf192..e97052fafcb 100644
--- a/clang-tools-extra/unittests/clangd/QualityTests.cpp
+++ b/clang-tools-extra/unittests/clangd/QualityTests.cpp
@@ -136,7 +136,7 @@ TEST(QualityTests, SymbolQualitySignalsSanity) {
EXPECT_LT(ReservedName.evaluate(), Default.evaluate());
SymbolQualitySignals WithReferences, ManyReferences;
- WithReferences.References = 10;
+ WithReferences.References = 20;
ManyReferences.References = 1000;
EXPECT_GT(WithReferences.evaluate(), Default.evaluate());
EXPECT_GT(ManyReferences.evaluate(), WithReferences.evaluate());
OpenPOWER on IntegriCloud