diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-07-20 18:28:29 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-07-20 18:28:29 +0300 |
commit | a4a3d5650d8a78bf0393d988e5e413e837d1cdb8 (patch) | |
tree | 2596fc69183b2ad959fd16916bccc282b94fc6d1 /source | |
parent | 66dd9fbf229f78207f2f7a8701bcb2da46328875 (diff) |
Minor optimization in CustomData_update_typemap().
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/customdata.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 82465172892..48c80ef584a 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; } } |