[PATCH] D60040: [clangd] Use capacity() instead of size() in RefSlab::bytes()

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 30 20:14:01 PDT 2019


nridge created this revision.
nridge added a reviewer: gribozavr.
Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov.
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D60040

Files:
  clang-tools-extra/clangd/index/Ref.h


Index: clang-tools-extra/clangd/index/Ref.h
===================================================================
--- clang-tools-extra/clangd/index/Ref.h
+++ clang-tools-extra/clangd/index/Ref.h
@@ -86,7 +86,7 @@
 
   size_t bytes() const {
     return sizeof(*this) + Arena.getTotalMemory() +
-           sizeof(value_type) * Refs.size();
+           sizeof(value_type) * Refs.capacity();
   }
 
   /// RefSlab::Builder is a mutable container that can 'freeze' to RefSlab.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60040.192997.patch
Type: text/x-patch
Size: 473 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190331/c378d957/attachment.bin>


More information about the cfe-commits mailing list