diff options
Diffstat (limited to 'intern/cycles/blender/blender_util.h')
-rw-r--r-- | intern/cycles/blender/blender_util.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h index 4feb8b556d5..0a9f2dd06aa 100644 --- a/intern/cycles/blender/blender_util.h +++ b/intern/cycles/blender/blender_util.h @@ -367,12 +367,22 @@ struct ObjectKey { bool operator<(const ObjectKey& k) const { - return (parent < k.parent) || - (parent == k.parent && (memcmp(id, k.id, sizeof(id)) < 0)) || - (memcmp(id, k.id, sizeof(id)) == 0 && ob < k.ob); + if(ob < k.ob) { + return true; + } + else if(ob == k.ob) { + if(parent < k.parent) + return true; + else if(parent == k.parent) + return memcmp(id, k.id, sizeof(id)) < 0; + } + + return false; } }; +/* Particle System Key */ + struct ParticleSystemKey { void *ob; int id[OBJECT_PERSISTENT_ID_SIZE]; @@ -389,8 +399,12 @@ struct ParticleSystemKey { bool operator<(const ParticleSystemKey& k) const { /* first id is particle index, we don't compare that */ - return (ob < k.ob) || - (ob == k.ob && (memcmp(id+1, k.id+1, sizeof(int)*(OBJECT_PERSISTENT_ID_SIZE-1)) < 0)); + if(ob < k.ob) + return true; + else if(ob == k.ob) + return memcmp(id+1, k.id+1, sizeof(int)*(OBJECT_PERSISTENT_ID_SIZE-1)) < 0; + + return false; } }; |