diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-10-01 16:04:10 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-10-01 16:22:05 +0300 |
commit | 1c7ce7e0b45b6613b22cee1515187f5a251932e7 (patch) | |
tree | 2fff420a933f4610ced84a9a0d82237814b09c68 | |
parent | 271210126e12713d70813937ddd4732993f7bb35 (diff) |
Cleanup: asset catalogs, make function const
Declare `AssetCatalogService::find_catalog()` as `const`, as it's not
requiring modification off the service object.
No functional changes.
-rw-r--r-- | source/blender/blenkernel/BKE_asset_catalog.hh | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/asset_catalog.cc | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_asset_catalog.hh b/source/blender/blenkernel/BKE_asset_catalog.hh index a0bc1267826..052cf8e9d1e 100644 --- a/source/blender/blenkernel/BKE_asset_catalog.hh +++ b/source/blender/blenkernel/BKE_asset_catalog.hh @@ -94,7 +94,7 @@ class AssetCatalogService { void merge_from_disk_before_writing(); /** Return catalog with the given ID. Return nullptr if not found. */ - AssetCatalog *find_catalog(CatalogID catalog_id); + AssetCatalog *find_catalog(CatalogID catalog_id) const; /** Return first catalog with the given path. Return nullptr if not found. This is not an * efficient call as it's just a linear search over the catalogs. */ diff --git a/source/blender/blenkernel/intern/asset_catalog.cc b/source/blender/blenkernel/intern/asset_catalog.cc index a948c0f96ff..34bd1fd49db 100644 --- a/source/blender/blenkernel/intern/asset_catalog.cc +++ b/source/blender/blenkernel/intern/asset_catalog.cc @@ -65,9 +65,9 @@ bool AssetCatalogService::is_empty() const return catalogs_.is_empty(); } -AssetCatalog *AssetCatalogService::find_catalog(CatalogID catalog_id) +AssetCatalog *AssetCatalogService::find_catalog(CatalogID catalog_id) const { - std::unique_ptr<AssetCatalog> *catalog_uptr_ptr = this->catalogs_.lookup_ptr(catalog_id); + const std::unique_ptr<AssetCatalog> *catalog_uptr_ptr = this->catalogs_.lookup_ptr(catalog_id); if (catalog_uptr_ptr == nullptr) { return nullptr; } |