Skip to content

Commit 38b7042

Browse files
author
Daniel Dahan
committed
development: updated for Xcode 8.3
1 parent b8c5f59 commit 38b7042

13 files changed

+46
-48
lines changed

Algorithm.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'Algorithm'
3-
s.version = '2.0.2'
3+
s.version = '2.0.3'
44
s.license = 'BSD-3-Clause'
55
s.summary = 'A toolset for writing algorithms in Swift.'
66
s.homepage = 'http://algorithmswift.io'

Algorithm.xcodeproj/xcshareddata/xcschemes/Algorithm iOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0830"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Algorithm.xcodeproj/xcshareddata/xcschemes/Algorithm macOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0830"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Sources/Algorithm+Array.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ extension Array where Element: Equatable {
4545
they exists.
4646
- Parameter objects: A list of Elements.
4747
*/
48-
@discardableResult
4948
mutating func remove(objects: Element...) {
5049
remove(objects: objects)
5150
}
@@ -55,8 +54,7 @@ extension Array where Element: Equatable {
5554
they exists.
5655
- Parameter objects: An Array of Elements.
5756
*/
58-
@discardableResult
59-
mutating func remove(objects: [Element]) {
57+
mutating func remove(objects: [Element]) {
6058
objects.forEach {
6159
self.remove(object: $0)
6260
}

Sources/DoublyLinkedList.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public struct DoublyLinkedList<Element>: CustomStringConvertible, Sequence {
6464
var c = 0
6565
var x = head
6666
while nil !== x {
67-
output += "\(x)"
67+
output += "\(String(describing: x))"
6868
c += 1
6969
if c != count {
7070
output += ", "

Sources/DoublyLinkedListNode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ internal class DoublyLinkedListNode<Element>: CustomStringConvertible {
5656
- returns: String
5757
*/
5858
internal var description: String {
59-
return "\(element)"
59+
return "\(String(describing: element))"
6060
}
6161

6262
/**

Sources/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.0.2</string>
18+
<string>2.0.3</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Sources/RedBlackNode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ internal class RedBlackNode<Key: Comparable, Value>: Comparable, Equatable, Cust
8686
- returns: String
8787
*/
8888
internal var description: String {
89-
return "(\(key), \(value))"
89+
return "(\(key), \(String(describing: value)))"
9090
}
9191

9292
/**

Tests/DequeTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@ class DequeTests: XCTestCase {
5050

5151
XCTAssert(3 == d.count, "Count incorrect, got \(d.count).")
5252

53-
XCTAssert(3 == d.front, "Front incorrect, got \(d.front)")
54-
XCTAssert(1 == d.back, "Back incorrect, got \(d.back)")
53+
XCTAssert(3 == d.front, "Front incorrect, got \(String(describing: d.front))")
54+
XCTAssert(1 == d.back, "Back incorrect, got \(String(describing: d.back))")
5555

5656
d.insert(atBack: 5)
5757
d.insert(atBack: 6)
5858
d.insert(atBack: 7)
5959

6060
XCTAssert(6 == d.count, "Count incorrect, got \(d.count).")
6161

62-
XCTAssert(3 == d.front, "Front incorrect, got \(d.front)")
63-
XCTAssert(7 == d.back, "Back incorrect, got \(d.back)")
62+
XCTAssert(3 == d.front, "Front incorrect, got \(String(describing: d.front))")
63+
XCTAssert(7 == d.back, "Back incorrect, got \(String(describing: d.back))")
6464

6565
XCTAssert(3 == d.removeAtFront() && 5 == d.count && 2 == d.front, "RemoveAtFront incorrect")
6666
XCTAssert(2 == d.removeAtFront() && 4 == d.count && 1 == d.front, "RemoveAtFront incorrect")

Tests/DoublyLinkedListTests.swift

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class DoublyLinkedListTests: XCTestCase {
5050

5151
XCTAssert(3 == l.count, "Count incorrect, got \(l.count).")
5252

53-
XCTAssert(3 == l.front, "Front incorrect, got \(l.front)")
54-
XCTAssert(1 == l.back, "Back incorrect, got \(l.back)")
53+
XCTAssert(3 == l.front, "Front incorrect, got \(String(describing: l.front))")
54+
XCTAssert(1 == l.back, "Back incorrect, got \(String(describing: l.back))")
5555

5656
l.insert(atBack: 5)
5757
l.insert(atBack: 6)
@@ -69,24 +69,24 @@ class DoublyLinkedListTests: XCTestCase {
6969

7070
XCTAssert(6 == l.count, "Count incorrect, got \(l.count).")
7171

72-
XCTAssert(3 == l.front, "Front incorrect, got \(l.front)")
73-
XCTAssert(7 == l.back, "Back incorrect, got \(l.back)")
72+
XCTAssert(3 == l.front, "Front incorrect, got \(String(describing: l.front))")
73+
XCTAssert(7 == l.back, "Back incorrect, got \(String(describing: l.back))")
7474

7575
l.cursorToFront()
76-
XCTAssert(3 == l.front && l.front == l.cursor, "Current incorrect, got \(l.cursor)")
77-
XCTAssert(2 == l.next(), "Test failed, got \(l.cursor)")
78-
XCTAssert(1 == l.next(), "Test failed, got \(l.cursor)")
79-
XCTAssert(5 == l.next(), "Test failed, got \(l.cursor)")
80-
XCTAssert(6 == l.next(), "Test failed, got \(l.cursor)")
81-
XCTAssert(7 == l.next(), "Test failed, got \(l.cursor)")
76+
XCTAssert(3 == l.front && l.front == l.cursor, "Current incorrect, got \(String(describing: l.cursor))")
77+
XCTAssert(2 == l.next(), "Test failed, got \(String(describing: l.cursor))")
78+
XCTAssert(1 == l.next(), "Test failed, got \(String(describing: l.cursor))")
79+
XCTAssert(5 == l.next(), "Test failed, got \(String(describing: l.cursor))")
80+
XCTAssert(6 == l.next(), "Test failed, got \(String(describing: l.cursor))")
81+
XCTAssert(7 == l.next(), "Test failed, got \(String(describing: l.cursor))")
8282

8383
l.cursorToBack()
84-
XCTAssert(7 == l.back && l.back == l.cursor, "Current incorrect, got \(l.cursor)")
85-
XCTAssert(6 == l.previous(), "Test failed, got \(l.cursor)")
86-
XCTAssert(5 == l.previous(), "Test failed, got \(l.cursor)")
87-
XCTAssert(1 == l.previous(), "Test failed, got \(l.cursor)")
88-
XCTAssert(2 == l.previous(), "Test failed, got \(l.cursor)")
89-
XCTAssert(3 == l.previous(), "Test failed, got \(l.cursor)")
84+
XCTAssert(7 == l.back && l.back == l.cursor, "Current incorrect, got \(String(describing: l.cursor))")
85+
XCTAssert(6 == l.previous(), "Test failed, got \(String(describing: l.cursor))")
86+
XCTAssert(5 == l.previous(), "Test failed, got \(String(describing: l.cursor))")
87+
XCTAssert(1 == l.previous(), "Test failed, got \(String(describing: l.cursor))")
88+
XCTAssert(2 == l.previous(), "Test failed, got \(String(describing: l.cursor))")
89+
XCTAssert(3 == l.previous(), "Test failed, got \(String(describing: l.cursor))")
9090

9191
l.cursorToFront()
9292
XCTAssert(3 == l.removeAtFront() && 5 == l.count, "Test failed.")
@@ -100,41 +100,41 @@ class DoublyLinkedListTests: XCTestCase {
100100

101101
l.removeAll()
102102
l.cursorToFront()
103-
XCTAssert(nil == l.cursor && 0 == l.count, "Test failed, got \(l.cursor)")
103+
XCTAssert(nil == l.cursor && 0 == l.count, "Test failed, got \(String(describing: l.cursor))")
104104
l.insert(beforeCursor: 1)
105-
XCTAssert(1 == l.cursor && 1 == l.count, "Test failed, got \(l.cursor)")
105+
XCTAssert(1 == l.cursor && 1 == l.count, "Test failed, got \(String(describing: l.cursor))")
106106

107107
l.removeAll()
108108
l.cursorToBack()
109-
XCTAssert(nil == l.cursor && 0 == l.count, "Test failed, got \(l.cursor)")
109+
XCTAssert(nil == l.cursor && 0 == l.count, "Test failed, got \(String(describing: l.cursor))")
110110
l.insert(afterCursor: 1)
111-
XCTAssert(1 == l.cursor && 1 == l.count, "Test failed, got \(l.cursor)")
111+
XCTAssert(1 == l.cursor && 1 == l.count, "Test failed, got \(String(describing: l.cursor))")
112112

113113
l.removeAll()
114114
l.insert(atBack: 1)
115-
XCTAssert(1 == l.cursor && 1 == l.count, "Test failed, got \(l.cursor)")
115+
XCTAssert(1 == l.cursor && 1 == l.count, "Test failed, got \(String(describing: l.cursor))")
116116
l.insert(afterCursor: 2)
117117
l.insert(afterCursor: 6)
118118
l.next()
119-
XCTAssert(6 == l.cursor && 3 == l.count, "Test failed, got \(l.cursor)")
119+
XCTAssert(6 == l.cursor && 3 == l.count, "Test failed, got \(String(describing: l.cursor))")
120120
l.insert(beforeCursor: 3)
121121
l.insert(beforeCursor: 5)
122122
l.previous()
123-
XCTAssert(5 == l.cursor && 5 == l.count, "Test failed, got \(l.cursor)")
123+
XCTAssert(5 == l.cursor && 5 == l.count, "Test failed, got \(String(describing: l.cursor))")
124124
l.insert(atBack: 4)
125125
l.previous()
126126
l.removeAtCursor()
127-
XCTAssert(5 == l.cursor && 5 == l.count, "Test failed, got \(l.cursor)")
127+
XCTAssert(5 == l.cursor && 5 == l.count, "Test failed, got \(String(describing: l.cursor))")
128128
l.removeAtCursor()
129-
XCTAssert(6 == l.cursor && 4 == l.count, "Test failed, got \(l.cursor)")
129+
XCTAssert(6 == l.cursor && 4 == l.count, "Test failed, got \(String(describing: l.cursor))")
130130
l.removeAtCursor()
131-
XCTAssert(2 == l.cursor && 3 == l.count, "Test failed, got \(l.cursor)")
131+
XCTAssert(2 == l.cursor && 3 == l.count, "Test failed, got \(String(describing: l.cursor))")
132132
l.removeAtCursor()
133-
XCTAssert(1 == l.previous() && 2 == l.count, "Test failed, got \(l.cursor)")
133+
XCTAssert(1 == l.previous() && 2 == l.count, "Test failed, got \(String(describing: l.cursor))")
134134
l.removeAtCursor()
135-
XCTAssert(l.front == l.cursor && l.back == l.cursor && 1 == l.count, "Test failed, got \(l.cursor)")
135+
XCTAssert(l.front == l.cursor && l.back == l.cursor && 1 == l.count, "Test failed, got \(String(describing: l.cursor))")
136136
l.removeAtCursor()
137-
XCTAssert(nil == l.cursor && 0 == l.count, "Test failed, got \(l.cursor)")
137+
XCTAssert(nil == l.cursor && 0 == l.count, "Test failed, got \(String(describing: l.cursor))")
138138

139139
l.insert(atFront: 1)
140140
l.insert(atBack: 2)

Tests/QueueTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ class QueueTests: XCTestCase {
4949
q.enqueue(3)
5050

5151
XCTAssert(3 == q.count, "Count incorrect, got \(q.count).")
52-
XCTAssert(1 == q.peek, "Peek incorrect, got \(q.peek)")
52+
XCTAssert(1 == q.peek, "Peek incorrect, got \(String(describing: q.peek))")
5353

5454
q.enqueue(5)
5555
q.enqueue(6)
5656
q.enqueue(7)
5757

5858
XCTAssert(6 == q.count, "Count incorrect, got \(q.count).")
59-
XCTAssert(1 == q.peek, "Peek incorrect, got \(q.peek)")
59+
XCTAssert(1 == q.peek, "Peek incorrect, got \(String(describing: q.peek))")
6060

6161
XCTAssert(1 == q.dequeue() && 5 == q.count && 2 == q.peek, "Dequeue incorrect")
6262
XCTAssert(2 == q.dequeue() && 4 == q.count && 3 == q.peek, "Dequeue incorrect")

Tests/SampleTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class SampleTests: XCTestCase {
187187
students.insert(value: peter, for: peter.name)
188188
students.insert(value: alex, for: alex.name)
189189

190-
for student in students {
190+
for _ in students {
191191
// Do something ...
192192
}
193193
}

Tests/StackTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ class StackTests: XCTestCase {
4949
s.push(3)
5050

5151
XCTAssert(3 == s.count, "Count incorrect, got \(s.count).")
52-
XCTAssert(3 == s.top, "Top incorrect, got \(s.top)")
52+
XCTAssert(3 == s.top, "Top incorrect, got \(String(describing: s.top))")
5353

5454
s.push(5)
5555
s.push(6)
5656
s.push(7)
5757

5858
XCTAssert(6 == s.count, "Count incorrect, got \(s.count).")
59-
XCTAssert(7 == s.top, "Top incorrect, got \(s.top)")
59+
XCTAssert(7 == s.top, "Top incorrect, got \(String(describing: s.top))")
6060

6161
XCTAssert(7 == s.pop() && 5 == s.count && 6 == s.top, "Pop incorrect")
6262
XCTAssert(6 == s.pop() && 4 == s.count && 5 == s.top, "Pop incorrect")

0 commit comments

Comments
 (0)