Skip to content

Commit 11fcad7

Browse files
committed
Replace spacing from 4 to 2 spaces to follow the repository's Swift Style guide.
1 parent 70781ec commit 11fcad7

File tree

3 files changed

+651
-676
lines changed

3 files changed

+651
-676
lines changed

Singly Linked List/KeyValuePair.swift

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,62 +3,62 @@
33
/// stored contain a value, but are ordered or retrieved according to a key.
44
public protocol KeyValuePair : Comparable {
55

6-
associatedtype K : Comparable, Hashable
7-
associatedtype V : Comparable, Hashable
8-
9-
// Identifier used in many algorithms to search by, order by, etc
10-
var key : K {get set}
11-
12-
// A data container
13-
var value : V {get set}
14-
15-
16-
/// Initializer
17-
///
18-
/// - Parameters:
19-
/// - key: Identifier used in many algorithms to search by, order by, etc.
20-
/// - value: A data container.
21-
init(key: K, value: V)
22-
23-
24-
/// Creates a copy
25-
///
26-
/// - Abstract: Conformers of this class can be either value or reference types.
27-
/// Some algorithms might need to guarantee that a conformer instance gets copied.
28-
/// This will perform an innecessary in the case of value types.
29-
/// TODO: is there a better way?
30-
/// - Returns: A new instance with the old one's values copied.
31-
func copy() -> Self
6+
associatedtype K : Comparable, Hashable
7+
associatedtype V : Comparable, Hashable
8+
9+
// Identifier used in many algorithms to search by, order by, etc
10+
var key : K {get set}
11+
12+
// A data container
13+
var value : V {get set}
14+
15+
16+
/// Initializer
17+
///
18+
/// - Parameters:
19+
/// - key: Identifier used in many algorithms to search by, order by, etc.
20+
/// - value: A data container.
21+
init(key: K, value: V)
22+
23+
24+
/// Creates a copy
25+
///
26+
/// - Abstract: Conformers of this class can be either value or reference types.
27+
/// Some algorithms might need to guarantee that a conformer instance gets copied.
28+
/// This will perform an innecessary in the case of value types.
29+
/// TODO: is there a better way?
30+
/// - Returns: A new instance with the old one's values copied.
31+
func copy() -> Self
3232
}
3333

3434

3535
/// Conformance to Equatable and Comparable protocols
3636
extension KeyValuePair {
3737

38-
// MARK: - Equatable protocol
39-
public static func ==(lhs: Self, rhs: Self) -> Bool {
40-
return lhs.key == rhs.key
41-
}
42-
43-
44-
45-
// MARK: - Comparable protocol
46-
47-
public static func <(lhs: Self, rhs: Self) -> Bool {
48-
return lhs.key < rhs.key
49-
}
50-
51-
public static func <=(lhs: Self, rhs: Self) -> Bool {
52-
return lhs.key <= rhs.key
53-
}
54-
55-
public static func >=(lhs: Self, rhs: Self) -> Bool {
56-
return lhs.key >= rhs.key
57-
}
58-
59-
public static func >(lhs: Self, rhs: Self) -> Bool {
60-
return lhs.key > rhs.key
61-
}
38+
// MARK: - Equatable protocol
39+
public static func ==(lhs: Self, rhs: Self) -> Bool {
40+
return lhs.key == rhs.key
41+
}
42+
43+
44+
45+
// MARK: - Comparable protocol
46+
47+
public static func <(lhs: Self, rhs: Self) -> Bool {
48+
return lhs.key < rhs.key
49+
}
50+
51+
public static func <=(lhs: Self, rhs: Self) -> Bool {
52+
return lhs.key <= rhs.key
53+
}
54+
55+
public static func >=(lhs: Self, rhs: Self) -> Bool {
56+
return lhs.key >= rhs.key
57+
}
58+
59+
public static func >(lhs: Self, rhs: Self) -> Bool {
60+
return lhs.key > rhs.key
61+
}
6262
}
6363

6464

@@ -67,11 +67,11 @@ extension KeyValuePair {
6767
/// are Integers.
6868
struct IntegerPair : KeyValuePair {
6969

70-
// MARK - KeyValuePair protocol
71-
var key : Int
72-
var value : Int
73-
74-
func copy() -> IntegerPair {
75-
return IntegerPair(key: self.key, value: self.value)
76-
}
70+
// MARK - KeyValuePair protocol
71+
var key : Int
72+
var value : Int
73+
74+
func copy() -> IntegerPair {
75+
return IntegerPair(key: self.key, value: self.value)
76+
}
7777
}

0 commit comments

Comments
 (0)