[Bf-blender-cvs] [a73b17564ce] functions: fix Vector.remove_first_occurrence_and_reorder

Jacques Lucke noreply at git.blender.org
Sat Jan 18 20:18:00 CET 2020


Commit: a73b17564ce0bb0658c885d76f3c457506d43767
Author: Jacques Lucke
Date:   Sat Jan 18 19:58:37 2020 +0100
Branches: functions
https://developer.blender.org/rBa73b17564ce0bb0658c885d76f3c457506d43767

fix Vector.remove_first_occurrence_and_reorder

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

M	source/blender/blenlib/BLI_vector.h

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

diff --git a/source/blender/blenlib/BLI_vector.h b/source/blender/blenlib/BLI_vector.h
index 8c1ac4380c1..a24c2a9fc8c 100644
--- a/source/blender/blenlib/BLI_vector.h
+++ b/source/blender/blenlib/BLI_vector.h
@@ -476,8 +476,9 @@ template<typename T, uint N = 4, typename Allocator = GuardedAllocator> class Ve
 
   void remove_first_occurrence_and_reorder(const T &value)
   {
-    uint index = this->index(value);
-    this->remove_and_reorder(index);
+    int index = this->index(value);
+    BLI_assert(index >= 0);
+    this->remove_and_reorder((uint)index);
   }
 
   /**



More information about the Bf-blender-cvs mailing list