[clangd] Use capacity() instead of size() in RefSlab::bytes()
authorIlya Biryukov <ibiryukov@google.com>
Tue, 2 Apr 2019 08:24:37 +0000 (08:24 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Tue, 2 Apr 2019 08:24:37 +0000 (08:24 +0000)
Patch by Nathan Ridge.

Reviewers: gribozavr

Reviewed By: gribozavr

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D60040

llvm-svn: 357454

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

index 389e276..4d6ae16 100644 (file)
@@ -86,7 +86,7 @@ public:
 
   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.