Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/asset/intern/asset_indexer.cc')
-rw-r--r--source/blender/editors/asset/intern/asset_indexer.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/asset/intern/asset_indexer.cc b/source/blender/editors/asset/intern/asset_indexer.cc
index 3cc3638c299..cc06fa80429 100644
--- a/source/blender/editors/asset/intern/asset_indexer.cc
+++ b/source/blender/editors/asset/intern/asset_indexer.cc
@@ -351,7 +351,7 @@ static void init_indexer_entry_from_value(FileIndexerEntry &indexer_entry,
{
indexer_entry.idcode = entry.get_idcode();
- const std::string &name = entry.get_name();
+ const std::string name = entry.get_name();
BLI_strncpy(
indexer_entry.datablock_info.name, name.c_str(), sizeof(indexer_entry.datablock_info.name));
@@ -359,19 +359,19 @@ static void init_indexer_entry_from_value(FileIndexerEntry &indexer_entry,
indexer_entry.datablock_info.asset_data = asset_data;
if (entry.has_description()) {
- const std::string &description = entry.get_description();
- char *description_c_str = static_cast<char *>(MEM_mallocN(description.length() + 1, __func__));
- BLI_strncpy(description_c_str, description.c_str(), description.length() + 1);
+ const StringRefNull description = entry.get_description();
+ char *description_c_str = static_cast<char *>(MEM_mallocN(description.size() + 1, __func__));
+ BLI_strncpy(description_c_str, description.c_str(), description.size() + 1);
asset_data->description = description_c_str;
}
if (entry.has_author()) {
- const std::string &author = entry.get_author();
- char *author_c_str = static_cast<char *>(MEM_mallocN(author.length() + 1, __func__));
- BLI_strncpy(author_c_str, author.c_str(), author.length() + 1);
+ const StringRefNull author = entry.get_author();
+ char *author_c_str = static_cast<char *>(MEM_mallocN(author.size() + 1, __func__));
+ BLI_strncpy(author_c_str, author.c_str(), author.size() + 1);
asset_data->author = author_c_str;
}
- const std::string &catalog_name = entry.get_catalog_name();
+ const StringRefNull catalog_name = entry.get_catalog_name();
BLI_strncpy(asset_data->catalog_simple_name,
catalog_name.c_str(),
sizeof(asset_data->catalog_simple_name));