Explorar o código

avoid unnecessary castings

cyberta %!s(int64=5) %!d(string=hai) anos
pai
achega
dd0eb7c40a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      deltachat-ios/Extensions/UIImage+Extension.swift

+ 1 - 1
deltachat-ios/Extensions/UIImage+Extension.swift

@@ -76,7 +76,7 @@ extension UIImage {
     // the size of PNG imgaes will be scaled down
     func scaleDownAndCompress(toMax: Float) -> UIImage? {
         let rect = getResizedRectangle(toMax: self.isTransparent() ?
-            Float(min(self.size.width / 2, CGFloat(toMax / 2))) :
+            min(Float(self.size.width) / 2, toMax / 2) :
             toMax)
 
         UIGraphicsBeginImageContextWithOptions(rect.size, !self.isTransparent(), 0.0)