Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <mail@jlucke.com>2019-09-14 15:41:19 +0300
committerJacques Lucke <mail@jlucke.com>2019-09-14 15:41:19 +0300
commita98760f7dad7948fc50613d2c39cb9cbe8a4fb08 (patch)
tree353411faffa99519c661e8bdfc84e1896a541f07 /source/blender/blenlib/BLI_vector.h
parent5b00ecf70bf6876d1279e8e8f73a5d722f77cb51 (diff)
BLI: speedup adding to VectorSet by removing a check
Diffstat (limited to 'source/blender/blenlib/BLI_vector.h')
-rw-r--r--source/blender/blenlib/BLI_vector.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/blenlib/BLI_vector.h b/source/blender/blenlib/BLI_vector.h
index c9701dcaa52..7a001c653d2 100644
--- a/source/blender/blenlib/BLI_vector.h
+++ b/source/blender/blenlib/BLI_vector.h
@@ -512,6 +512,14 @@ template<typename T, uint N = 4, typename Allocator = GuardedAllocator> class Ve
return m_end;
}
+ /**
+ * Get the current capacity of the vector.
+ */
+ uint capacity() const
+ {
+ return (uint)(m_capacity_end - m_begin);
+ }
+
void print_stats() const
{
std::cout << "Small Vector at " << (void *)this << ":" << std::endl;
@@ -538,11 +546,6 @@ template<typename T, uint N = 4, typename Allocator = GuardedAllocator> class Ve
}
}
- uint capacity() const
- {
- return (uint)(m_capacity_end - m_begin);
- }
-
BLI_NOINLINE void grow(uint min_capacity)
{
if (this->capacity() >= min_capacity) {