The N+1 optimization in save_image() pre-lowercases the existing_files list before passing to get_unique_filename(). However, this broke the API contract: the function should handle any-case input to remain robust. Changed: get_unique_filename() now defensively lowercases the input list, ensuring collision detection works regardless of input case. Benefits: - Fixes implicit API contract change (function expected any-case input) - Maintains N+1 optimization (pre-lowercasing still works) - Supports both optimization and edge cases (direct function calls) - All 22 tests pass
6.0 KiB
6.0 KiB