[Bf-blender-cvs] [a4a3d56] master: Minor optimization in CustomData_update_typemap().

Bastien Montagne noreply at git.blender.org
Mon Jul 20 22:22:59 CEST 2015


Commit: a4a3d5650d8a78bf0393d988e5e413e837d1cdb8
Author: Bastien Montagne
Date:   Mon Jul 20 17:28:29 2015 +0200
Branches: master
https://developer.blender.org/rBa4a3d5650d8a78bf0393d988e5e413e837d1cdb8

Minor optimization in CustomData_update_typemap().

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

M	source/blender/blenkernel/intern/customdata.c

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

diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 8246517..48c80ef 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -1418,10 +1418,11 @@ void CustomData_update_typemap(CustomData *data)
 	}
 
 	for (i = 0; i < data->totlayer; i++) {
-		if (data->layers[i].type != lasttype) {
-			data->typemap[data->layers[i].type] = i;
+		const int type = data->layers[i].type;
+		if (type != lasttype) {
+			data->typemap[type] = i;
+			lasttype = type;
 		}
-		lasttype = data->layers[i].type;
 	}
 }




More information about the Bf-blender-cvs mailing list