- Add `collection_object_remove_no_gobject_hash` useful for clearing all
objects in a collection as there is no need for a lookup in this case.
- Use BLI_ghash_ensure_p to avoid multiple lookups.
- Functions now ensure the hash:
BKE_collection_has_object, BKE_collection_object_replace.
- Improve code-comments.
Add a hash for faster look-ups on collection->gobject,
This avoids a full list lookup for every object added via Python's
CollectionObject.link as well as linking via BKE_collection_object_add_*
functions.
While the speedup is non-linear, linking & unlinking 100k objects from
Python is about 50x faster. Although unlinking all objects in order
(a best-case for linked lists) is ~18% slower.