From 614621747ea214efc72a095fbef6695bf98a2bb4 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 23 Apr 2020 11:57:58 +0200 Subject: BLI: optimize VectorSet implementation Instead of building on top of `BLI::Vector`, just use a raw array and handle the growing in `BLI::VectorSet`. After this change, the existing `EdgeSet` can be reimplemented using `BLI::VectorSet` without performance regressions. --- source/blender/blenlib/BLI_vector.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenlib/BLI_vector.hh') diff --git a/source/blender/blenlib/BLI_vector.hh b/source/blender/blenlib/BLI_vector.hh index a44962e50cc..450242a349a 100644 --- a/source/blender/blenlib/BLI_vector.hh +++ b/source/blender/blenlib/BLI_vector.hh @@ -49,7 +49,7 @@ template class Ve T *m_end; T *m_capacity_end; Allocator m_allocator; - AlignedBuffer m_small_buffer; + AlignedBuffer<(uint)sizeof(T) * N, (uint)alignof(T)> m_small_buffer; #ifndef NDEBUG /* Storing size in debug builds, because it makes debugging much easier sometimes. */ -- cgit v1.2.3