Skip to content

Commit a945a1d

Browse files
author
Daniel Dahan
committed
development: minor updates
1 parent 7ad29bd commit a945a1d

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Sources/Algorithm+Array.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,23 @@
2929
*/
3030

3131
extension Array where Element: Equatable {
32-
mutating func remove(object: Element) -> Element? {
32+
@discardableResult
33+
mutating func remove(object: Element) -> Element? {
3334
if let v: Int = index(of: object) {
3435
return remove(at: v)
3536
}
3637
return nil
3738
}
3839

40+
@discardableResult
3941
mutating func remove(objects: Element...) {
4042
remove(objects: objects)
4143
}
4244

45+
@discardableResult
4346
mutating func remove(objects: [Element]) {
4447
for x in objects {
45-
_ = remove(object: x)
48+
remove(object: x)
4649
}
4750
}
4851
}

Sources/Deque.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public class Deque<Element>: CustomStringConvertible, Sequence {
117117
and remove it.
118118
- returns: Element?
119119
*/
120-
public func removeAtFront() -> Element? {
120+
public func removeAtFront() -> Element? {
121121
return list.removeAtFront()
122122
}
123123

Sources/RedBlackTree.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ public class RedBlackTree<Key: Comparable, Value>: ProbableType, Collection, Cus
255255
:description: Insert a key / value pair.
256256
- returns: Bool
257257
*/
258+
@discardableResult
258259
public func insert(_ key: Key, value: Value?) -> Bool {
259260
return sentinel !== internalInsert(key, value: value)
260261
}
@@ -275,7 +276,7 @@ public class RedBlackTree<Key: Comparable, Value>: ProbableType, Collection, Cus
275276
*/
276277
public func insert(_ nodes: Array<(Key, Value?)>) {
277278
for (k, v) in nodes {
278-
_ = insert(k, value: v)
279+
insert(k, value: v)
279280
}
280281
}
281282

0 commit comments

Comments
 (0)