Cleanup: Add comment explaining assert

This triggers fairly often during development, so it might save some
frustration at some point to have a comment here.
This commit is contained in:
Hans Goudey 2021-06-03 18:06:14 -04:00
parent dba3fb9e09
commit c18675b12c
1 changed files with 1 additions and 0 deletions

View File

@ -658,6 +658,7 @@ GVArrayPtr CustomDataAttributes::get_for_read(const StringRef name,
std::optional<GMutableSpan> CustomDataAttributes::get_for_write(const StringRef name)
{
/* If this assert hits, it most likely means that #reallocate was not called at some point. */
BLI_assert(size_ != 0);
for (CustomDataLayer &layer : MutableSpan(data.layers, data.totlayer)) {
if (layer.name == name) {