Skip cleanup if there's only one single file #104582

Merged
Brecht Van Lommel merged 2 commits from Walles/blender-addons:johan/single-file into main 2023-06-27 10:14:13 +02:00
Contributor

Fixes #104573

Before this change we tried to cleanup a list consisting of a single file only. Then, since that single file had the same prefix as itself, we removed it from the list.

With this change in place, we skip cleanup if there's only one single file.

Tested using file name banana-color.webp.

Fixes https://projects.blender.org/blender/blender-addons/issues/104573 Before this change we tried to cleanup a list consisting of a single file only. Then, since that single file had the same prefix as itself, we removed it from the list. With this change in place, we skip cleanup if there's only one single file. Tested using file name `banana-color.webp`.
Johan Walles force-pushed johan/single-file from 81b43c1d8d to d5d3477f8c 2023-06-26 06:42:41 +02:00 Compare
Johan Walles requested review from Brecht Van Lommel 2023-06-26 06:43:31 +02:00
Brecht Van Lommel requested changes 2023-06-26 11:02:08 +02:00
@ -104,3 +104,3 @@
all_tags.update(socket_tags)
while True:
while names_to_tag_lists and len(names_to_tag_lists) > 1:

I think this is testing for the same thing twice? This can't be None, and empty dictionaries return false.

I think this is testing for the same thing twice? This can't be None, and empty dictionaries return false.
Author
Contributor

Let's see.

The first part before and is true if the list is at least 1 long.

The second part after and is true if the list is at least 2 long.

And as you say, since the list is initialized to empty higher up and thus can't be None I believe you are right!

I'll fix this.

Let's see. The first part before `and` is true if the list is at least 1 long. The second part after `and` is true if the list is at least 2 long. And as you say, since the list is initialized to empty higher up and thus can't be `None` I believe you are right! I'll fix this.
Walles marked this conversation as resolved
Johan Walles force-pushed johan/single-file from 137033a590 to daee55f8fc 2023-06-26 19:48:28 +02:00 Compare
Brecht Van Lommel approved these changes 2023-06-27 10:11:50 +02:00
Brecht Van Lommel merged commit cbf4156ebc into main 2023-06-27 10:14:13 +02:00
Brecht Van Lommel deleted branch johan/single-file 2023-06-27 10:14:14 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#104582
No description provided.