[PATCH] D51691: [clangd] NFC: Document URIDistance

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 5 12:54:45 PDT 2018


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/FileDistance.h:66
 // Supports lookups to find the minimum distance to a file from any source.
-// This object should be reused, it memoizes intermediate computations.
+// This object should be reused, it memorizes intermediate computations.
 class FileDistance {
----------------
memoizes is correct here
https://en.wikipedia.org/wiki/Memoization


================
Comment at: clang-tools-extra/clangd/FileDistance.h:89
 public:
+  // Memorizes paths from \p Sources and builds efficient structure for URI
+  // distance computations. \p Sources must contain absolute paths, not URIs.
----------------
The constructor doesn't do any computation, thus there's nothing to memoize.

I'd suggest dropping the second sentence here, that's the only noteworthy thing specific to this constructor.


https://reviews.llvm.org/D51691





More information about the cfe-commits mailing list