Cleanup: A few small tweaks in asset library code
- Fix a typo - Remove unnecessary namespace specification - Use "this" to access class methods
This commit is contained in:
@@ -138,7 +138,7 @@ class AssetLibrary {
|
||||
* Remove an asset from the library that was added using #add_external_asset() or
|
||||
* #add_local_id_asset(). Can usually be expected to be constant time complexity (worst case may
|
||||
* differ).
|
||||
* \note This is save to call if \a asset is freed (dangling reference), will not perform any
|
||||
* \note This is safe to call if \a asset is freed (dangling reference), will not perform any
|
||||
* change then.
|
||||
* \return True on success, false if the asset couldn't be found inside the library (also the
|
||||
* case when the reference is dangling).
|
||||
|
||||
@@ -207,14 +207,14 @@ AssetRepresentation &AssetLibrary::add_external_asset(StringRef relative_asset_p
|
||||
const int id_type,
|
||||
std::unique_ptr<AssetMetaData> metadata)
|
||||
{
|
||||
AssetIdentifier identifier = asset_identifier_from_library(relative_asset_path);
|
||||
AssetIdentifier identifier = this->asset_identifier_from_library(relative_asset_path);
|
||||
return asset_storage_->add_external_asset(
|
||||
std::move(identifier), name, id_type, std::move(metadata), *this);
|
||||
}
|
||||
|
||||
AssetRepresentation &AssetLibrary::add_local_id_asset(StringRef relative_asset_path, ID &id)
|
||||
{
|
||||
AssetIdentifier identifier = asset_identifier_from_library(relative_asset_path);
|
||||
AssetIdentifier identifier = this->asset_identifier_from_library(relative_asset_path);
|
||||
return asset_storage_->add_local_id_asset(std::move(identifier), id, *this);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ bool AssetStorage::remove_asset(AssetRepresentation &asset)
|
||||
return external_assets_.remove_as(&asset);
|
||||
}
|
||||
|
||||
void AssetStorage::remap_ids_and_remove_invalid(const blender::bke::id::IDRemapper &mappings)
|
||||
void AssetStorage::remap_ids_and_remove_invalid(const bke::id::IDRemapper &mappings)
|
||||
{
|
||||
Set<AssetRepresentation *> removed_assets;
|
||||
|
||||
@@ -61,7 +61,7 @@ void AssetStorage::remap_ids_and_remove_invalid(const blender::bke::id::IDRemapp
|
||||
}
|
||||
|
||||
for (AssetRepresentation *asset : removed_assets) {
|
||||
remove_asset(*asset);
|
||||
this->remove_asset(*asset);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user