소스 검색

Update to swift on XCode 7 Beta 6

Emily Toop 10 년 전
부모
커밋
d213648648
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      Base32/Base32.swift

+ 2 - 2
Base32/Base32.swift

@@ -280,7 +280,7 @@ private func base32decode(string: String, table: [UInt8]) -> [UInt8]? {
     
     // search element index that condition is true.
     func index_of<C : CollectionType where C.Generator.Element : Equatable>(domain: C, condition: C.Generator.Element -> Bool) -> C.Index? {
-        return lazy(domain).map(condition).indexOf(true)
+        return domain.lazy.map(condition).indexOf(true)
     }
     
     // calc padding length
@@ -302,7 +302,7 @@ private func base32decode(string: String, table: [UInt8]) -> [UInt8]? {
     let leastPaddingLength = getLeastPaddingLength(string)
     if let index = index_of(string.unicodeScalars, condition: {$0.value > 0xff || table[Int($0.value)] > 31}) {
         // index points padding "=" or invalid character that table does not contain.
-        let pos = distance(string.unicodeScalars.startIndex, index)
+        let pos = string.unicodeScalars.startIndex.distanceTo(index)
         // if pos points padding "=", it's valid.
         if pos != length - leastPaddingLength {
             print("string contains some invalid characters.")