Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <mail@jlucke.com>2020-02-01 13:58:50 +0300
committerJacques Lucke <mail@jlucke.com>2020-02-01 13:58:50 +0300
commit599e8f7bb10d7aeeab2060f0b6124f11e9944f91 (patch)
treead5de99f0f49c4296f96e21233796ec127d6211d /source/blender/simulations/bparticles
parent26f4fa9de73b46b82de21660f371a5e80dcfd600 (diff)
cleanup same size asserts
Diffstat (limited to 'source/blender/simulations/bparticles')
-rw-r--r--source/blender/simulations/bparticles/emitters.cpp4
-rw-r--r--source/blender/simulations/bparticles/particle_action.hpp2
-rw-r--r--source/blender/simulations/bparticles/particle_allocator.cpp2
-rw-r--r--source/blender/simulations/bparticles/simulate.cpp2
-rw-r--r--source/blender/simulations/bparticles/world_state.hpp2
5 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/simulations/bparticles/emitters.cpp b/source/blender/simulations/bparticles/emitters.cpp
index 3f0004751fd..773720eaf8e 100644
--- a/source/blender/simulations/bparticles/emitters.cpp
+++ b/source/blender/simulations/bparticles/emitters.cpp
@@ -166,7 +166,7 @@ static BLI_NOINLINE void compute_triangle_areas(Mesh *mesh,
ArrayRef<MLoopTri> triangles,
MutableArrayRef<float> r_areas)
{
- BLI_assert(triangles.size() == r_areas.size());
+ BLI::assert_same_size(triangles, r_areas);
for (uint i : triangles.index_range()) {
const MLoopTri &triangle = triangles[i];
@@ -205,7 +205,7 @@ static BLI_NOINLINE void sample_looptris(Mesh *mesh,
MutableArrayRef<float3> r_sampled_normals,
MutableArrayRef<float3> r_sampled_bary_coords)
{
- BLI_assert(triangles_to_sample.size() == r_sampled_positions.size());
+ BLI::assert_same_size(triangles_to_sample, r_sampled_positions);
MLoop *loops = mesh->mloop;
MVert *verts = mesh->mvert;
diff --git a/source/blender/simulations/bparticles/particle_action.hpp b/source/blender/simulations/bparticles/particle_action.hpp
index b52904a40d1..a50d5aefdf9 100644
--- a/source/blender/simulations/bparticles/particle_action.hpp
+++ b/source/blender/simulations/bparticles/particle_action.hpp
@@ -36,7 +36,7 @@ class ParticleActionContext {
m_custom_context_ids(custom_context_ids),
m_custom_contexts(custom_contexts)
{
- BLI_assert(m_custom_context_ids.size() == m_custom_contexts.size());
+ BLI::assert_same_size(m_custom_context_ids, m_custom_contexts);
}
ArrayRef<BLI::class_id_t> custom_context_ids() const
diff --git a/source/blender/simulations/bparticles/particle_allocator.cpp b/source/blender/simulations/bparticles/particle_allocator.cpp
index 6c76d9d9c92..ae4abf1cc4d 100644
--- a/source/blender/simulations/bparticles/particle_allocator.cpp
+++ b/source/blender/simulations/bparticles/particle_allocator.cpp
@@ -19,7 +19,7 @@ void ParticleAllocator::initialize_new_particles(AttributesRefGroup &attributes_
MutableArrayRef<int32_t> particle_ids = attributes.get<int32_t>("ID");
IndexRange new_ids = m_state.get_new_particle_ids(attributes.size());
- BLI_assert(particle_ids.size() == new_ids.size());
+ BLI::assert_same_size(particle_ids, new_ids);
for (uint i = 0; i < new_ids.size(); i++) {
particle_ids[i] = new_ids[i];
}
diff --git a/source/blender/simulations/bparticles/simulate.cpp b/source/blender/simulations/bparticles/simulate.cpp
index 8214a3dff87..e05b4baa4d9 100644
--- a/source/blender/simulations/bparticles/simulate.cpp
+++ b/source/blender/simulations/bparticles/simulate.cpp
@@ -151,7 +151,7 @@ BLI_NOINLINE static void execute_events(BlockStepData &step_data,
ArrayRef<float> current_times,
ArrayRef<Event *> events)
{
- BLI_assert(events.size() == pindices_per_event.size());
+ BLI::assert_same_size(events, pindices_per_event);
for (uint event_index : events.index_range()) {
Event *event = events[event_index];
diff --git a/source/blender/simulations/bparticles/world_state.hpp b/source/blender/simulations/bparticles/world_state.hpp
index 01b4c29d81b..6de009e2b6f 100644
--- a/source/blender/simulations/bparticles/world_state.hpp
+++ b/source/blender/simulations/bparticles/world_state.hpp
@@ -49,7 +49,7 @@ struct VaryingFloat4x4 {
float time_offset,
MutableArrayRef<float4x4> r_results) const
{
- BLI_assert(times.size() == r_results.size());
+ BLI::assert_same_size(times, r_results);
for (uint i : times.index_range()) {
r_results[i] = this->interpolate(times[i] + time_offset);
}