Cleanup: remove useless extra-processing after BKE_id_new_name_validate() call.
This function already handles sorting of ID in its listbase.
This commit is contained in:
@@ -2015,9 +2015,8 @@ void BLI_libblock_ensure_unique_name(Main *bmain, const char *name)
|
||||
/* search for id */
|
||||
idtest = BLI_findstring(lb, name + 2, offsetof(ID, name) + 2);
|
||||
if (idtest != NULL) {
|
||||
if (!BKE_id_new_name_validate(lb, idtest, idtest->name + 2)) {
|
||||
id_sort_by_name(lb, idtest);
|
||||
}
|
||||
/* BKE_id_new_name_validate also takes care of sorting. */
|
||||
BKE_id_new_name_validate(lb, idtest, NULL);
|
||||
bmain->is_memfile_undo_written = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -442,7 +442,7 @@ static void versions_gpencil_add_main(ListBase *lb, ID *id, const char *name)
|
||||
*( (short *)id->name) = ID_GD;
|
||||
|
||||
BKE_id_new_name_validate(lb, id, name);
|
||||
/* alphabetic insertion: is in new_id */
|
||||
/* alphabetic insertion: is in BKE_id_new_name_validate */
|
||||
|
||||
if (G.debug & G_DEBUG)
|
||||
printf("Converted GPencil to ID: %s\n", id->name + 2);
|
||||
|
||||
Reference in New Issue
Block a user