[Bf-blender-cvs] [1978ac65c4] master: collada: use local variable to avoid repeated call of bone chain_length_calculator

Gaia Clary noreply at git.blender.org
Thu Mar 23 15:03:17 CET 2017


Commit: 1978ac65c43533d4539c1b06621ef999c8d0a5c2
Author: Gaia Clary
Date:   Tue Mar 21 17:13:31 2017 +0100
Branches: master
https://developer.blender.org/rB1978ac65c43533d4539c1b06621ef999c8d0a5c2

collada: use local variable to avoid repeated call of bone chain_length_calculator

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

M	source/blender/collada/ArmatureImporter.cpp

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

diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index 5b3340a938..d5c1af9347 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -290,12 +290,13 @@ void ArmatureImporter::connect_bone_chains(bArmature *armature, Bone *parentbone
 		for (; child; child = child->next) {
 			BoneExtended *be = extended_bones[child->name];
 			if (be != NULL) {
-				if (be->get_chain_length() <= clip) {
-					if (be->get_chain_length() > maxlen) {
+				int chain_len = be->get_chain_length();
+				if (chain_len <= clip) {
+					if (chain_len > maxlen) {
 						dominant_child = be;
-						maxlen = be->get_chain_length();
+						maxlen = chain_len;
 					}
-					else if (be->get_chain_length() == maxlen) {
+					else if (chain_len == maxlen) {
 						dominant_child = NULL;
 					}
 				}




More information about the Bf-blender-cvs mailing list