[Bf-blender-cvs] [d3e05090a88] attribute-accessor: cleanup

Jacques Lucke noreply at git.blender.org
Tue Nov 17 13:55:42 CET 2020


Commit: d3e05090a88bd5d1d2bcf3766e95acf13019b7ed
Author: Jacques Lucke
Date:   Tue Nov 17 13:27:58 2020 +0100
Branches: attribute-accessor
https://developer.blender.org/rBd3e05090a88bd5d1d2bcf3766e95acf13019b7ed

cleanup

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

M	source/blender/blenkernel/BKE_attribute_accessor.hh
M	source/blender/blenkernel/intern/attribute_accessor.cc

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

diff --git a/source/blender/blenkernel/BKE_attribute_accessor.hh b/source/blender/blenkernel/BKE_attribute_accessor.hh
index ce744baa762..8f71e4d304f 100644
--- a/source/blender/blenkernel/BKE_attribute_accessor.hh
+++ b/source/blender/blenkernel/BKE_attribute_accessor.hh
@@ -29,13 +29,13 @@ using fn::CPPType;
 
 class AttributeAccessor {
  protected:
-  AttributeDomain domain_;
-  const CPPType *cpp_type_;
-  int64_t size_;
+  const AttributeDomain domain_;
+  const CPPType &cpp_type_;
+  const int64_t size_;
 
  public:
   AttributeAccessor(AttributeDomain domain, const CPPType &cpp_type, const int64_t size)
-      : domain_(domain), cpp_type_(&cpp_type), size_(size)
+      : domain_(domain), cpp_type_(cpp_type), size_(size)
   {
   }
 
@@ -48,7 +48,7 @@ class AttributeAccessor {
 
   const CPPType &cpp_type() const
   {
-    return *cpp_type_;
+    return cpp_type_;
   }
 
   int64_t size() const
diff --git a/source/blender/blenkernel/intern/attribute_accessor.cc b/source/blender/blenkernel/intern/attribute_accessor.cc
index 66e125398c4..73b656057bf 100644
--- a/source/blender/blenkernel/intern/attribute_accessor.cc
+++ b/source/blender/blenkernel/intern/attribute_accessor.cc
@@ -113,7 +113,7 @@ class ConstantAttributeAccessor final : public AttributeAccessor {
 
   void access_single(const int64_t UNUSED(index), void *r_value) const override
   {
-    this->cpp_type_->copy_to_uninitialized(value_, r_value);
+    this->cpp_type_.copy_to_uninitialized(value_, r_value);
   }
 };



More information about the Bf-blender-cvs mailing list