diff options
author | Julian Eisel <julian@blender.org> | 2021-11-05 18:35:52 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-11-05 20:27:55 +0300 |
commit | cc49c479a746314d9620d84e5513f08b2faeea71 (patch) | |
tree | 6386c0a9b735f65dcf1fede4e7bc0ae7238c59a1 /source/blender/editors/asset | |
parent | aaf86bad87d68dfb5ec2b745bdc3ac8ce114b365 (diff) |
Cleanup: Use reference for non-optional C++ parameter
A reference makes clear that NULL is not an expected value. So it's the
prefered way of passing a `const` input parameter (at least if it may
not be cheap to copy).
Diffstat (limited to 'source/blender/editors/asset')
-rw-r--r-- | source/blender/editors/asset/ED_asset_list.hh | 2 | ||||
-rw-r--r-- | source/blender/editors/asset/intern/asset_list.cc | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/asset/ED_asset_list.hh b/source/blender/editors/asset/ED_asset_list.hh index dcc07f54e75..24def2fb4ab 100644 --- a/source/blender/editors/asset/ED_asset_list.hh +++ b/source/blender/editors/asset/ED_asset_list.hh @@ -35,4 +35,4 @@ std::string ED_assetlist_asset_filepath_get(const bContext *C, /* Can return false to stop iterating. */ using AssetListIterFn = blender::FunctionRef<bool(AssetHandle)>; -void ED_assetlist_iterate(const AssetLibraryReference *library_reference, AssetListIterFn fn); +void ED_assetlist_iterate(const AssetLibraryReference &library_reference, AssetListIterFn fn); diff --git a/source/blender/editors/asset/intern/asset_list.cc b/source/blender/editors/asset/intern/asset_list.cc index b5ea054fb5d..c1b1e33d428 100644 --- a/source/blender/editors/asset/intern/asset_list.cc +++ b/source/blender/editors/asset/intern/asset_list.cc @@ -456,9 +456,9 @@ bool ED_assetlist_storage_has_list_for_library(const AssetLibraryReference *libr return AssetListStorage::lookup_list(*library_reference) != nullptr; } -void ED_assetlist_iterate(const AssetLibraryReference *library_reference, AssetListIterFn fn) +void ED_assetlist_iterate(const AssetLibraryReference &library_reference, AssetListIterFn fn) { - AssetList *list = AssetListStorage::lookup_list(*library_reference); + AssetList *list = AssetListStorage::lookup_list(library_reference); if (list) { list->iterate(fn); } |