소스 검색

Uses guard instead of if

Valeriy Van 6 년 전
부모
커밋
7c5576a429
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      Sources/CryptoSwift/Collection+Extension.swift

+ 2 - 2
Sources/CryptoSwift/Collection+Extension.swift

@@ -15,7 +15,7 @@
 extension Collection where Self.Element == UInt8, Self.Index == Int {
   // Big endian order
   func toUInt32Array() -> Array<UInt32> {
-    if isEmpty {
+    guard !isEmpty else {
       return []
     }
 
@@ -30,7 +30,7 @@ extension Collection where Self.Element == UInt8, Self.Index == Int {
 
   // Big endian order
   func toUInt64Array() -> Array<UInt64> {
-    if isEmpty {
+    guard !isEmpty else {
       return []
     }