Skip to content
This repository was archived by the owner on May 8, 2022. It is now read-only.

Commit c1a05c7

Browse files
committed
Updated to swift 5
1 parent 5ad5c24 commit c1a05c7

File tree

7 files changed

+27
-16
lines changed

7 files changed

+27
-16
lines changed

Example/Pods/Pods.xcodeproj/project.pbxproj

+9-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Pods.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Fuse.xcscheme

+1-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Fuse/Classes/Fuse.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public class Fuse {
156156

157157
// Exact match
158158
if (pattern.text == text) {
159-
return (0, [CountableClosedRange<Int>(0...textLength - 1)])
159+
return (0, [0...textLength - 1])
160160
}
161161

162162
let location = self.location
@@ -305,7 +305,7 @@ extension Fuse {
305305
/// - text: the text string to search for.
306306
/// - aString: The string in which to search for the pattern
307307
/// - Returns: A tuple containing a `score` between `0.0` (exact match) and `1` (not a match), and `ranges` of the matched characters.
308-
public func search(_ text: String, in aString: String) -> (score: Double, ranges: [CountableClosedRange<Int>])? {
308+
public func search(_ text: String, in aString: String) -> (score: Double, ranges: [ClosedRange<Int>])? {
309309
return self.search(self.createPattern(from: text), in: aString)
310310
}
311311

Fuse/Classes/FuseUtilities.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ class FuseUtilities {
6363
start = n
6464
} else if bit == 0 && start != -1 {
6565
end = n - 1
66-
ranges.append(CountableClosedRange<Int>(start...end))
66+
ranges.append(start...end)
6767
start = -1
6868
}
6969
}
7070
if mask.last == 1 {
71-
ranges.append(CountableClosedRange<Int>(start...mask.count - 1))
71+
ranges.append(start...mask.count - 1)
7272
}
7373
return ranges
7474
}

Fuse/Classes/String+Fuse.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extension String {
3131
return nil
3232
}
3333

34-
if self.startIndex.encodedOffset + position > self.endIndex.encodedOffset {
34+
if self.startIndex.utf16Offset(in: self) + position > self.endIndex.utf16Offset(in: self) {
3535
return nil
3636
}
3737

0 commit comments

Comments
 (0)