Page MenuHome

Cleanup: Simplify NULL handling for BKE_image_find_nearest_tile
ClosedPublic

Authored by Chris Blackbourn (chrisbblend) on Aug 4 2022, 1:52 AM.

Diff Detail

Repository
rB Blender

Event Timeline

Chris Blackbourn (chrisbblend) requested review of this revision.Aug 4 2022, 1:52 AM
Chris Blackbourn (chrisbblend) created this revision.
Campbell Barton (campbellbarton) accepted this revision.EditedAug 5 2022, 9:56 AM

At first I wasn't so keen on this change, as it's common for the first argument of most BKE_* functions that take ID data-blocks as their first argument to have non-null arguments.

However accessing the size & aspect allows a NULL image which use useful fallback values, so this seems like a case where a default fallback in the case of a null image is reasonable too.

Accepting, although the patch subject & description need to be updated. The TODO should be either removed or expanded on (explaining why it is buggy).

This revision is now accepted and ready to land.Aug 5 2022, 9:56 AM
Campbell Barton (campbellbarton) retitled this revision from WIP to Cleanup: Simplify NULL handling for BKE_image_find_nearest_tile.Aug 9 2022, 1:20 PM