[Bf-blender-cvs] [2fb0c20f531] master: Cleanup: remove unreachable return values

Campbell Barton noreply at git.blender.org
Fri Feb 3 10:04:17 CET 2023


Commit: 2fb0c20f5315e5819b7d50eb0e37586b87c895fd
Author: Campbell Barton
Date:   Fri Feb 3 20:02:25 2023 +1100
Branches: master
https://developer.blender.org/rB2fb0c20f5315e5819b7d50eb0e37586b87c895fd

Cleanup: remove unreachable return values

===================================================================

M	source/blender/editors/space_file/filelist.cc
M	source/blender/modifiers/intern/MOD_particleinstance.cc

===================================================================

diff --git a/source/blender/editors/space_file/filelist.cc b/source/blender/editors/space_file/filelist.cc
index 000de4b860c..2c63c3460de 100644
--- a/source/blender/editors/space_file/filelist.cc
+++ b/source/blender/editors/space_file/filelist.cc
@@ -2233,46 +2233,40 @@ static bool filelist_file_cache_block_create(FileList *filelist,
 {
   FileListEntryCache *cache = &filelist->filelist_cache;
 
-  {
-    int i, idx;
+  int i, idx;
 
-    for (i = 0, idx = start_index; i < size; i++, idx++, cursor++) {
-      FileDirEntry *entry;
+  for (i = 0, idx = start_index; i < size; i++, idx++, cursor++) {
+    FileDirEntry *entry;
 
-      /* That entry might have already been requested and stored in misc cache... */
-      if ((entry = static_cast<FileDirEntry *>(BLI_ghash_popkey(
-               cache->misc_entries, POINTER_FROM_INT(idx), nullptr))) == nullptr) {
-        entry = filelist_file_create_entry(filelist, idx);
-        BLI_ghash_insert(cache->uids, POINTER_FROM_UINT(entry->uid), entry);
-      }
-      cache->block_entries[cursor] = entry;
+    /* That entry might have already been requested and stored in misc cache... */
+    if ((entry = static_cast<FileDirEntry *>(
+             BLI_ghash_popkey(cache->misc_entries, POINTER_FROM_INT(idx), nullptr))) == nullptr) {
+      entry = filelist_file_create_entry(filelist, idx);
+      BLI_ghash_insert(cache->uids, POINTER_FROM_UINT(entry->uid), entry);
     }
-    return true;
+    cache->block_entries[cursor] = entry;
   }
-
-  return false;
+  return true;
 }
 
 static void filelist_file_cache_block_release(FileList *filelist, const int size, int cursor)
 {
   FileListEntryCache *cache = &filelist->filelist_cache;
 
-  {
-    int i;
+  int i;
 
-    for (i = 0; i < size; i++, cursor++) {
-      FileDirEntry *entry = cache->block_entries[cursor];
+  for (i = 0; i < size; i++, cursor++) {
+    FileDirEntry *entry = cache->block_entries[cursor];
 #if 0
       printf("%s: release cacheidx %d (%%p %%s)\n",
              __func__,
              cursor /*, cache->block_entries[cursor], cache->block_entries[cursor]->relpath*/);
 #endif
-      BLI_ghash_remove(cache->uids, POINTER_FROM_UINT(entry->uid), nullptr, nullptr);
-      filelist_file_release_entry(filelist, entry);
+    BLI_ghash_remove(cache->uids, POINTER_FROM_UINT(entry->uid), nullptr, nullptr);
+    filelist_file_release_entry(filelist, entry);
 #ifndef NDEBUG
-      cache->block_entries[cursor] = nullptr;
+    cache->block_entries[cursor] = nullptr;
 #endif
-    }
   }
 }
 
diff --git a/source/blender/modifiers/intern/MOD_particleinstance.cc b/source/blender/modifiers/intern/MOD_particleinstance.cc
index 8e3856942ac..751ec2916b5 100644
--- a/source/blender/modifiers/intern/MOD_particleinstance.cc
+++ b/source/blender/modifiers/intern/MOD_particleinstance.cc
@@ -180,8 +180,6 @@ static bool particle_skip(ParticleInstanceModifierData *pimd, ParticleSystem *ps
   }
 
   return true;
-
-  return false;
 }
 
 static void store_float_in_vcol(MLoopCol *vcol, float float_value)



More information about the Bf-blender-cvs mailing list