Procházet zdrojové kódy

Merge pull request #1183 from wolfcolony/feature/optimize_by_reduce

Optimize MD5 String By `reduce` Function
Wei Wang před 6 roky
rodič
revize
c1e9183bac
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      Sources/Utility/String+MD5.swift

+ 1 - 1
Sources/Utility/String+MD5.swift

@@ -44,6 +44,6 @@ extension KingfisherWrapper where Base == String {
         }
         #endif
         
-        return digest.map { String(format: "%02x", $0) }.joined()
+        return digest.reduce(into: "") { $0 += String(format: "%02x", $1) }
     }
 }