Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove IImageCache #2391

Merged
merged 4 commits into from
Dec 17, 2024
Merged

Remove IImageCache #2391

merged 4 commits into from
Dec 17, 2024

Conversation

erri120
Copy link
Member

@erri120 erri120 commented Dec 16, 2024

No description provided.

@erri120 erri120 requested a review from a team December 16, 2024 14:22
@erri120 erri120 self-assigned this Dec 16, 2024
@Sewer56 Sewer56 self-requested a review December 16, 2024 14:56
{
try
{
if (optionImage.TryPickT0(out var uri, out var imageStoredFile))
Copy link
Member

@Sewer56 Sewer56 Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is technically not incorrect, but it 'feels' a bit weird. Technically you should prefer loading a local file, so you really should be asking 'do I have a local file' instead of 'do I have a URL'.

While in this case there isn't a functional difference, because it's a OneOf; I thought I'd point it out. Someone looking at this code may misinterpret it; since the Try methods in a branch like this are usually used with dictionaries. I had to double take, until I saw it was a OneOf

Consider flipping the condition, i.e. TryPickT1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've simplified the code using Match.

Copy link
Member

@Sewer56 Sewer56 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest is ok, just the comment above.

@erri120 erri120 merged commit 16e75a2 into Nexus-Mods:main Dec 17, 2024
12 checks passed
@erri120 erri120 deleted the remove-imagecache branch December 17, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants