[Bf-blender-cvs] [d206062e107] functions: implicitely convert SmallSetVector to ArrayRef
Jacques Lucke
noreply at git.blender.org
Sat Jun 29 16:25:54 CEST 2019
Commit: d206062e1070b18249c63a6ebfeaccb4ddb0b132
Author: Jacques Lucke
Date: Sat Jun 29 15:11:22 2019 +0200
Branches: functions
https://developer.blender.org/rBd206062e1070b18249c63a6ebfeaccb4ddb0b132
implicitely convert SmallSetVector to ArrayRef
===================================================================
M source/blender/blenlib/BLI_small_set_vector.hpp
M source/blender/simulations/bparticles/attributes.hpp
M source/blender/simulations/bparticles/simulate.cpp
===================================================================
diff --git a/source/blender/blenlib/BLI_small_set_vector.hpp b/source/blender/blenlib/BLI_small_set_vector.hpp
index 7441e3daf88..ffd45490aee 100644
--- a/source/blender/blenlib/BLI_small_set_vector.hpp
+++ b/source/blender/blenlib/BLI_small_set_vector.hpp
@@ -54,12 +54,12 @@ template<typename T> class SmallSetVector : public SmallSet<T> {
* Gives access to the underlying array of values.
* The values should not be changed in ways that would modify their hash.
*/
- ArrayRef<T> values() const
+ operator ArrayRef<T>() const
{
return ArrayRef<T>(this->begin(), this->size());
}
- T operator[](const int index) const
+ T &operator[](const int index) const
{
BLI_assert(index >= 0 && index < this->size());
return this->m_elements[index];
diff --git a/source/blender/simulations/bparticles/attributes.hpp b/source/blender/simulations/bparticles/attributes.hpp
index 2e21b1ca729..85f36e1c0b8 100644
--- a/source/blender/simulations/bparticles/attributes.hpp
+++ b/source/blender/simulations/bparticles/attributes.hpp
@@ -65,7 +65,7 @@ class AttributesInfo {
StringRefNull name_of(uint index) const
{
- return m_indices.values()[index];
+ return m_indices[index];
}
AttributeType type_of(uint index) const
diff --git a/source/blender/simulations/bparticles/simulate.cpp b/source/blender/simulations/bparticles/simulate.cpp
index 35d07615cb6..ca86fdbc688 100644
--- a/source/blender/simulations/bparticles/simulate.cpp
+++ b/source/blender/simulations/bparticles/simulate.cpp
@@ -577,8 +577,7 @@ BLI_NOINLINE static AttributesInfo build_attribute_info_for_type(ParticleType &t
float_attributes.add_multiple(type.float_attributes());
float3_attributes.add_multiple(type.float3_attributes());
- return AttributesInfo(
- byte_attributes.values(), float_attributes.values(), float3_attributes.values());
+ return AttributesInfo(byte_attributes, float_attributes, float3_attributes);
}
BLI_NOINLINE static void ensure_required_attributes_exist(
More information about the Bf-blender-cvs
mailing list