Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-09-25 00:15:52 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-09-25 00:16:37 +0400
commit6f2f80887b10f6a704a7394f0580e6ee39ea611d (patch)
treef27b5f9f2d009e2784fc058c22581a95b9d834da /source/blender/blenkernel/intern/seqcache.c
parentfaaf0c719f3310759bf5f2c9be76f6788a923364 (diff)
GHash: use bool for comparison (simplify compare)
Diffstat (limited to 'source/blender/blenkernel/intern/seqcache.c')
-rw-r--r--source/blender/blenkernel/intern/seqcache.c87
1 files changed, 13 insertions, 74 deletions
diff --git a/source/blender/blenkernel/intern/seqcache.c b/source/blender/blenkernel/intern/seqcache.c
index 97062f728c5..4268b33cb14 100644
--- a/source/blender/blenkernel/intern/seqcache.c
+++ b/source/blender/blenkernel/intern/seqcache.c
@@ -69,58 +69,15 @@ static struct SeqPreprocessCache *preprocess_cache = NULL;
static void preprocessed_cache_destruct(void);
-static int seq_cmp_render_data(const SeqRenderData *a, const SeqRenderData *b)
+static bool seq_cmp_render_data(const SeqRenderData *a, const SeqRenderData *b)
{
- if (a->preview_render_size < b->preview_render_size) {
- return -1;
- }
- if (a->preview_render_size > b->preview_render_size) {
- return 1;
- }
-
- if (a->rectx < b->rectx) {
- return -1;
- }
- if (a->rectx > b->rectx) {
- return 1;
- }
-
- if (a->recty < b->recty) {
- return -1;
- }
- if (a->recty > b->recty) {
- return 1;
- }
-
- if (a->bmain < b->bmain) {
- return -1;
- }
- if (a->bmain > b->bmain) {
- return 1;
- }
-
- if (a->scene < b->scene) {
- return -1;
- }
- if (a->scene > b->scene) {
- return 1;
- }
-
- if (a->motion_blur_shutter < b->motion_blur_shutter) {
- return -1;
- }
- if (a->motion_blur_shutter > b->motion_blur_shutter) {
- return 1;
- }
-
- if (a->motion_blur_samples < b->motion_blur_samples) {
- return -1;
- }
- if (a->motion_blur_samples > b->motion_blur_samples) {
- return 1;
- }
-
- return 0;
+ return ((a->preview_render_size != b->preview_render_size) ||
+ (a->rectx != b->rectx) ||
+ (a->recty != b->recty) ||
+ (a->bmain != b->bmain) ||
+ (a->scene != b->scene) ||
+ (a->motion_blur_shutter != b->motion_blur_shutter) ||
+ (a->motion_blur_samples != b->motion_blur_samples));
}
static unsigned int seq_hash_render_data(const SeqRenderData *a)
@@ -148,33 +105,15 @@ static unsigned int seqcache_hashhash(const void *key_)
return rval;
}
-static int seqcache_hashcmp(const void *a_, const void *b_)
+static bool seqcache_hashcmp(const void *a_, const void *b_)
{
const SeqCacheKey *a = (SeqCacheKey *) a_;
const SeqCacheKey *b = (SeqCacheKey *) b_;
- if (a->seq < b->seq) {
- return -1;
- }
- if (a->seq > b->seq) {
- return 1;
- }
-
- if (a->cfra < b->cfra) {
- return -1;
- }
- if (a->cfra > b->cfra) {
- return 1;
- }
-
- if (a->type < b->type) {
- return -1;
- }
- if (a->type > b->type) {
- return 1;
- }
-
- return seq_cmp_render_data(&a->context, &b->context);
+ return ((a->seq != b->seq) ||
+ (a->cfra != b->cfra) ||
+ (a->type != b->type) ||
+ seq_cmp_render_data(&a->context, &b->context));
}
void BKE_sequencer_cache_destruct(void)