[Bf-blender-cvs] [a90504303e7] master: Reorder fields in boolean's ITT_value to save memory.

Howard Trickey noreply at git.blender.org
Sun Dec 6 16:58:57 CET 2020


Commit: a90504303e78030d5be2c039848d7134a829942f
Author: Howard Trickey
Date:   Sun Dec 6 10:58:14 2020 -0500
Branches: master
https://developer.blender.org/rBa90504303e78030d5be2c039848d7134a829942f

Reorder fields in boolean's ITT_value to save memory.

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

M	source/blender/blenlib/intern/mesh_intersect.cc

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

diff --git a/source/blender/blenlib/intern/mesh_intersect.cc b/source/blender/blenlib/intern/mesh_intersect.cc
index ab956c5c735..85a6ab42013 100644
--- a/source/blender/blenlib/intern/mesh_intersect.cc
+++ b/source/blender/blenlib/intern/mesh_intersect.cc
@@ -1055,36 +1055,36 @@ static std::ostream &operator<<(std::ostream &os, const CoplanarClusterInfo &cli
 enum ITT_value_kind { INONE, IPOINT, ISEGMENT, ICOPLANAR };
 
 struct ITT_value {
-  enum ITT_value_kind kind;
   mpq3 p1;      /* Only relevant for IPOINT and ISEGMENT kind. */
   mpq3 p2;      /* Only relevant for ISEGMENT kind. */
   int t_source; /* Index of the source triangle that intersected the target one. */
+  enum ITT_value_kind kind;
 
-  ITT_value() : kind(INONE), t_source(-1)
+  ITT_value() : t_source(-1), kind(INONE)
   {
   }
-  ITT_value(ITT_value_kind k) : kind(k), t_source(-1)
+  ITT_value(ITT_value_kind k) : t_source(-1), kind(k)
   {
   }
-  ITT_value(ITT_value_kind k, int tsrc) : kind(k), t_source(tsrc)
+  ITT_value(ITT_value_kind k, int tsrc) : t_source(tsrc), kind(k)
   {
   }
-  ITT_value(ITT_value_kind k, const mpq3 &p1) : kind(k), p1(p1), t_source(-1)
+  ITT_value(ITT_value_kind k, const mpq3 &p1) : p1(p1), t_source(-1), kind(k)
   {
   }
   ITT_value(ITT_value_kind k, const mpq3 &p1, const mpq3 &p2)
-      : kind(k), p1(p1), p2(p2), t_source(-1)
+      : p1(p1), p2(p2), t_source(-1), kind(k)
   {
   }
   ITT_value(const ITT_value &other)
-      : kind(other.kind), p1(other.p1), p2(other.p2), t_source(other.t_source)
+      : p1(other.p1), p2(other.p2), t_source(other.t_source), kind(other.kind)
   {
   }
   ITT_value(ITT_value &&other) noexcept
-      : kind(other.kind),
-        p1(std::move(other.p1)),
+      : p1(std::move(other.p1)),
         p2(std::move(other.p2)),
-        t_source(other.t_source)
+        t_source(other.t_source),
+        kind(other.kind)
   {
   }
   ~ITT_value()



More information about the Bf-blender-cvs mailing list