[Bf-blender-cvs] [2a957e405da] functions: cleanup small vector

Jacques Lucke noreply at git.blender.org
Fri May 3 12:43:31 CEST 2019


Commit: 2a957e405da4142c63a5d8577833c617da04251d
Author: Jacques Lucke
Date:   Fri May 3 11:37:58 2019 +0200
Branches: functions
https://developer.blender.org/rB2a957e405da4142c63a5d8577833c617da04251d

cleanup small vector

===================================================================

M	source/blender/blenlib/BLI_small_vector.hpp

===================================================================

diff --git a/source/blender/blenlib/BLI_small_vector.hpp b/source/blender/blenlib/BLI_small_vector.hpp
index aba74d2850f..37406723770 100644
--- a/source/blender/blenlib/BLI_small_vector.hpp
+++ b/source/blender/blenlib/BLI_small_vector.hpp
@@ -103,15 +103,14 @@ template<typename T, uint N = 4> class SmallVector {
   void append(const T &value)
   {
     this->ensure_space_for_one();
-    std::uninitialized_copy(&value, &value + 1, this->end());
+    std::uninitialized_copy_n(&value, 1, this->end());
     m_size++;
   }
 
   void append(T &&value)
   {
     this->ensure_space_for_one();
-    std::uninitialized_copy(
-        std::make_move_iterator(&value), std::make_move_iterator(&value + 1), this->end());
+    std::uninitialized_copy_n(std::make_move_iterator(&value), 1, this->end());
     m_size++;
   }



More information about the Bf-blender-cvs mailing list