[PATCH] D51636: [clangd] NFC: Change quality type to float
Kirill Bobyrev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 4 08:19:02 PDT 2018
kbobyrev created this revision.
kbobyrev added reviewers: ioeric, ilya-biryukov, sammccall.
kbobyrev added a project: clang-tools-extra.
Herald added subscribers: kadircet, arphaman, jkorous, MaskRay.
For the sake of consistency, `quality()` should return `float` instead of `double` since all of the scoring calculation happens to be in `float`s.
https://reviews.llvm.org/D51636
Files:
clang-tools-extra/clangd/index/Index.cpp
clang-tools-extra/clangd/index/Index.h
Index: clang-tools-extra/clangd/index/Index.h
===================================================================
--- clang-tools-extra/clangd/index/Index.h
+++ clang-tools-extra/clangd/index/Index.h
@@ -250,7 +250,7 @@
// This currently falls in the range [1, ln(#indexed documents)].
// FIXME: this should probably be split into symbol -> signals
// and signals -> score, so it can be reused for Sema completions.
-double quality(const Symbol &S);
+float quality(const Symbol &S);
// An immutable symbol container that stores a set of symbols.
// The container will maintain the lifetime of the symbols.
Index: clang-tools-extra/clangd/index/Index.cpp
===================================================================
--- clang-tools-extra/clangd/index/Index.cpp
+++ clang-tools-extra/clangd/index/Index.cpp
@@ -59,7 +59,7 @@
return OS << S.Scope << S.Name;
}
-double quality(const Symbol &S) {
+float quality(const Symbol &S) {
// 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 (S.References < 3)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51636.163833.patch
Type: text/x-patch
Size: 1133 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180904/3fc224fa/attachment.bin>
More information about the cfe-commits
mailing list