diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-09-25 00:15:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-09-25 00:16:37 +0400 |
commit | 6f2f80887b10f6a704a7394f0580e6ee39ea611d (patch) | |
tree | f27b5f9f2d009e2784fc058c22581a95b9d834da /source/blender/imbuf/intern/colormanagement.c | |
parent | faaf0c719f3310759bf5f2c9be76f6788a923364 (diff) |
GHash: use bool for comparison (simplify compare)
Diffstat (limited to 'source/blender/imbuf/intern/colormanagement.c')
-rw-r--r-- | source/blender/imbuf/intern/colormanagement.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index 06dd128137b..5dd6b366a93 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -252,22 +252,13 @@ static unsigned int colormanage_hashhash(const void *key_v) return rval; } -static int colormanage_hashcmp(const void *av, const void *bv) +static bool colormanage_hashcmp(const void *av, const void *bv) { const ColormanageCacheKey *a = (ColormanageCacheKey *) av; const ColormanageCacheKey *b = (ColormanageCacheKey *) bv; - if (a->view < b->view) - return -1; - else if (a->view > b->view) - return 1; - - if (a->display < b->display) - return -1; - else if (a->display > b->display) - return 1; - - return 0; + return ((a->view != b->view) || + (a->display != b->display)); } static struct MovieCache *colormanage_moviecache_ensure(ImBuf *ibuf) |