diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 13:30:43 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 14:38:06 +0300 |
commit | 1b272a649b40e99dba4185167f6cee7cbece1942 (patch) | |
tree | 2785f52c566b36cbdcbf9355f698dc520ffbb482 /source/blender/blenkernel/intern/pointcache.c | |
parent | cfc6f9eb18e701f5be601b95c45004e8cf7fbc81 (diff) |
Cleanup: Blenkernel, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenkernel` module.
No functional changes.
Diffstat (limited to 'source/blender/blenkernel/intern/pointcache.c')
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index c2c5b42dbb0..ae18f3289e4 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -1404,9 +1404,8 @@ static int ptcache_dynamicpaint_totpoint(void *sd, int UNUSED(cfra)) if (!surface->data) { return 0; } - else { - return surface->data->total_points; - } + + return surface->data->total_points; } static void ptcache_dynamicpaint_error(void *UNUSED(sd), const char *UNUSED(message)) @@ -2128,7 +2127,7 @@ static int ptcache_path(PTCacheID *pid, char *filename) return BLI_path_slash_ensure(filename); /* new strlen() */ } - else if (G.relbase_valid || lib) { + if (G.relbase_valid || lib) { char file[MAX_PTCACHE_PATH]; /* we don't want the dir, only the file */ BLI_split_file_part(blendfilename, file, sizeof(file)); @@ -2521,9 +2520,8 @@ int BKE_ptcache_mem_index_find(PTCacheMem *pm, unsigned int index) return -1; } - else { - return (index < pm->totpoint ? index : -1); - } + + return (index < pm->totpoint ? index : -1); } void BKE_ptcache_mem_pointers_init(PTCacheMem *pm) @@ -2627,10 +2625,10 @@ static int ptcache_old_elemsize(PTCacheID *pid) if (pid->type == PTCACHE_TYPE_SOFTBODY) { return 6 * sizeof(float); } - else if (pid->type == PTCACHE_TYPE_PARTICLES) { + if (pid->type == PTCACHE_TYPE_PARTICLES) { return sizeof(ParticleKey); } - else if (pid->type == PTCACHE_TYPE_CLOTH) { + if (pid->type == PTCACHE_TYPE_CLOTH) { return 9 * sizeof(float); } @@ -3585,16 +3583,15 @@ int BKE_ptcache_id_exist(PTCacheID *pid, int cfra) return BLI_exists(filename); } - else { - PTCacheMem *pm = pid->cache->mem_cache.first; - for (; pm; pm = pm->next) { - if (pm->frame == cfra) { - return 1; - } + PTCacheMem *pm = pid->cache->mem_cache.first; + + for (; pm; pm = pm->next) { + if (pm->frame == cfra) { + return 1; } - return 0; } + return 0; } void BKE_ptcache_id_time( PTCacheID *pid, Scene *scene, float cfra, int *startframe, int *endframe, float *timescale) |