Sfoglia il codice sorgente

Simplify return statements

Patrick Barron 4 anni fa
parent
commit
d983d65d8a
1 ha cambiato i file con 2 aggiunte e 12 eliminazioni
  1. 2 12
      Jellyfin.Drawing.Skia/SkiaEncoder.cs

+ 2 - 12
Jellyfin.Drawing.Skia/SkiaEncoder.cs

@@ -244,12 +244,7 @@ namespace Jellyfin.Drawing.Skia
                 }
             }
 
-            if (HasDiacritics(path))
-            {
-                return true;
-            }
-
-            return false;
+            return HasDiacritics(path);
         }
 
         private string NormalizePath(string path)
@@ -349,12 +344,7 @@ namespace Jellyfin.Drawing.Skia
             if (cropWhitespace)
             {
                 using var bitmap = Decode(path, forceAnalyzeBitmap, orientation, out origin);
-                if (bitmap == null)
-                {
-                    return null;
-                }
-
-                return CropWhiteSpace(bitmap);
+                return bitmap == null ? null : CropWhiteSpace(bitmap);
             }
 
             return Decode(path, forceAnalyzeBitmap, orientation, out origin);