diff --git a/source/blender/blenlib/BLI_vector.hh b/source/blender/blenlib/BLI_vector.hh index 67f83264db3..27b7708f21e 100644 --- a/source/blender/blenlib/BLI_vector.hh +++ b/source/blender/blenlib/BLI_vector.hh @@ -243,7 +243,9 @@ class Vector { const int64_t size = other.size(); if (other.is_inline()) { - if (size <= InlineBufferCapacity) { + /* This first check is not strictly necessary, but improves performance because it can be + * done at compile time and makes the size check at run-time unnecessary. */ + if (OtherInlineBufferCapacity <= InlineBufferCapacity || size <= InlineBufferCapacity) { /* Copy between inline buffers. */ uninitialized_relocate_n(other.begin_, size, begin_); end_ = begin_ + size;