[Bf-blender-cvs] [5c2fff306ed] master: Cleanup: Use LISTBASE_FOREACH macro

Hans Goudey noreply at git.blender.org
Thu Jul 28 23:07:38 CEST 2022


Commit: 5c2fff306edb7b37e04c6cbbe35646c4be82f0ff
Author: Hans Goudey
Date:   Thu Jul 28 16:02:46 2022 -0500
Branches: master
https://developer.blender.org/rB5c2fff306edb7b37e04c6cbbe35646c4be82f0ff

Cleanup: Use LISTBASE_FOREACH macro

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

M	source/blender/editors/asset/intern/asset_library_reference_enum.cc

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

diff --git a/source/blender/editors/asset/intern/asset_library_reference_enum.cc b/source/blender/editors/asset/intern/asset_library_reference_enum.cc
index 67e253a4fcd..773838a54cd 100644
--- a/source/blender/editors/asset/intern/asset_library_reference_enum.cc
+++ b/source/blender/editors/asset/intern/asset_library_reference_enum.cc
@@ -97,10 +97,8 @@ const EnumPropertyItem *ED_asset_library_reference_to_rna_enum_itemf(
     RNA_enum_item_add_separator(&item, &totitem);
   }
 
-  int i = 0;
-  for (bUserAssetLibrary *user_library = (bUserAssetLibrary *)U.asset_libraries.first;
-       user_library;
-       user_library = user_library->next, i++) {
+  int i;
+  LISTBASE_FOREACH_INDEX (bUserAssetLibrary *, user_library, &U.asset_libraries, i) {
     /* Note that the path itself isn't checked for validity here. If an invalid library path is
      * used, the Asset Browser can give a nice hint on what's wrong. */
     const bool is_valid = (user_library->name[0] && user_library->path[0]);



More information about the Bf-blender-cvs mailing list