Blender Git Loki

Git Commits -> Revision 4ed3a62

Revision 4ed3a62 by Bastien Montagne (master)
December 20, 2019, 13:29 (GMT)
ID Management: Fix/Sanitize code used when creating or renaming an ID.

This commit affects `check_for_dupid()` helper:
* Fix (serious though rare) bug where several IDs could end up with
exact same name (happened with over 10k IDs with same very long name).
* Fix (relatively harmless) func reporting it did not change the given
name when it actually had truncated it.
* Sanitize handling of supported min/max number suffixes (it now handles
between 1 and 1 billion, which should be way more than enough).
* Sanitize general logic to (hopefully!) make it easier to follow.
* General cleanup (naming, comments, variables scope, remove dead code, etc.).

Note that general performances here remain the same, there is no
measurable gain or loss. Algorithm remain also the same globally.

Attempt to use a GHash to speed up checks of used names proved to be
much worse, just building the GHash would already take as much time as
the whole process with current code...

Commit Details:

Full Hash: 4ed3a62d0f472b462d78edb01e8c3b4bd0bb3561
Parent Commit: d840658
Lines Changed: +99, -91

1 Modified Path:

/source/blender/blenkernel/intern/library.c (+99, -91) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021