From dee0b56b9216de8f37589b15be2d21cc1b946773 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Tue, 14 Sep 2021 16:08:09 +0200 Subject: Cleanup: simplify resource scope methods Previously, a debug name had to be passed to all methods that added a resource to the `ResourceScope`. The idea was that this would make it easier to find certain bugs. In reality I never found this to be useful, and it was mostly annoying. The thing is, something that is in a resource scope never leaks (unless the resource scope is not destructed of course). Removing the name parameter makes the structure easier to use. --- source/blender/functions/FN_field.hh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/blender/functions/FN_field.hh') diff --git a/source/blender/functions/FN_field.hh b/source/blender/functions/FN_field.hh index d6259bce435..d4375b625ce 100644 --- a/source/blender/functions/FN_field.hh +++ b/source/blender/functions/FN_field.hh @@ -381,7 +381,7 @@ class FieldEvaluator : NonMovable, NonCopyable { /** Same as #add_with_destination but typed. */ template int add_with_destination(Field field, VMutableArray &dst) { - GVMutableArray &varray = scope_.construct>(__func__, dst); + GVMutableArray &varray = scope_.construct>(dst); return this->add_with_destination(GField(std::move(field)), varray); } @@ -401,7 +401,7 @@ class FieldEvaluator : NonMovable, NonCopyable { */ template int add_with_destination(Field field, MutableSpan dst) { - GVMutableArray &varray = scope_.construct>(__func__, dst); + GVMutableArray &varray = scope_.construct>(dst); return this->add_with_destination(std::move(field), varray); } @@ -417,10 +417,10 @@ class FieldEvaluator : NonMovable, NonCopyable { { const int field_index = fields_to_evaluate_.append_and_get_index(std::move(field)); dst_varrays_.append(nullptr); - output_pointer_infos_.append(OutputPointerInfo{ - varray_ptr, [](void *dst, const GVArray &varray, ResourceScope &scope) { - *(const VArray **)dst = &*scope.construct>(__func__, varray); - }}); + output_pointer_infos_.append( + OutputPointerInfo{varray_ptr, [](void *dst, const GVArray &varray, ResourceScope &scope) { + *(const VArray **)dst = &*scope.construct>(varray); + }}); return field_index; } @@ -443,7 +443,7 @@ class FieldEvaluator : NonMovable, NonCopyable { template const VArray &get_evaluated(const int field_index) { const GVArray &varray = this->get_evaluated(field_index); - GVArray_Typed &typed_varray = scope_.construct>(__func__, varray); + GVArray_Typed &typed_varray = scope_.construct>(varray); return *typed_varray; } -- cgit v1.2.3