Skip to content

Commit 6f59c0e

Browse files
committed
Remove unused code
1 parent 9e8e612 commit 6f59c0e

File tree

1 file changed

+0
-60
lines changed

1 file changed

+0
-60
lines changed

Tool/Sources/CodeDiff/CodeDiff.swift

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -206,66 +206,6 @@ extension Array {
206206
}
207207
}
208208

209-
extension CodeDiff.LineDiff.Change {
210-
var range: NSRange {
211-
switch self {
212-
case let .insert(offset, element, _):
213-
return NSRange(location: offset, length: element.count)
214-
case let .remove(offset, element, _):
215-
return NSRange(location: offset, length: element.count)
216-
}
217-
}
218-
219-
var element: String {
220-
switch self {
221-
case let .insert(_, element, _):
222-
return element
223-
case let .remove(_, element, _):
224-
return element
225-
}
226-
}
227-
228-
var offset: Int {
229-
switch self {
230-
case let .insert(offset, _, _):
231-
return offset
232-
case let .remove(offset, _, _):
233-
return offset
234-
}
235-
}
236-
237-
func earlierThan(offset: Int) -> Bool {
238-
range.upperBound < offset
239-
}
240-
241-
func rebased(in subRange: NSRange, text: String) -> Self? {
242-
let thisRange = range
243-
guard let intersection = thisRange.intersection(subRange) else { return nil }
244-
let rebasedLocation = max(0, intersection.location - subRange.location)
245-
let length = intersection.length
246-
let rebasedRange = Range(NSRange(location: rebasedLocation, length: length), in: text)
247-
let element = if let rebasedRange {
248-
String(text[rebasedRange])
249-
} else {
250-
""
251-
}
252-
switch self {
253-
case let .insert(_, _, associatedWith):
254-
return .insert(
255-
offset: rebasedLocation,
256-
element: element,
257-
associatedWith: associatedWith
258-
)
259-
case let .remove(_, _, associatedWith):
260-
return .remove(
261-
offset: rebasedLocation,
262-
element: element,
263-
associatedWith: associatedWith
264-
)
265-
}
266-
}
267-
}
268-
269209
#if DEBUG
270210

271211
import SwiftUI

0 commit comments

Comments
 (0)