Skip to content

Commit 71c0e32

Browse files
committed
[swiftlint] Fix rule: colon (i.e. should be next to identifier)
warning: Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
1 parent 44adf5a commit 71c0e32

File tree

12 files changed

+17
-17
lines changed

12 files changed

+17
-17
lines changed

Diff for: Bucket Sort/BucketSort.playground/Sources/BucketSort.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public struct InsertionSorter: Sorter {
122122
// MARK: Bucket
123123
//////////////////////////////////////
124124

125-
public struct Bucket<T:Sortable> {
125+
public struct Bucket<T: Sortable> {
126126
var elements: [T]
127127
let capacity: Int
128128

Diff for: Bucket Sort/BucketSort.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public struct InsertionSorter: Sorter {
173173
// MARK: Bucket
174174
//////////////////////////////////////
175175

176-
public struct Bucket<T:Sortable> {
176+
public struct Bucket<T: Sortable> {
177177
var elements: [T]
178178
let capacity: Int
179179

Diff for: Convex Hull/Convex Hull/View.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class View: UIView {
150150
let context = UIGraphicsGetCurrentContext()
151151

152152
// Draw hull
153-
let lineWidth:CGFloat = 2.0
153+
let lineWidth: CGFloat = 2.0
154154

155155
context!.setFillColor(UIColor.black.cgColor)
156156
context!.setLineWidth(lineWidth)

Diff for: Deque/Deque-Optimized.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public struct Deque<T> {
77
private var array: [T?]
88
private var head: Int
99
private var capacity: Int
10-
private let originalCapacity:Int
10+
private let originalCapacity: Int
1111

1212
public init(_ capacity: Int = 10) {
1313
self.capacity = max(capacity, 1)

Diff for: Linked List/LinkedList.playground/Contents.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public final class LinkedList<T> {
177177
if list.isEmpty { return }
178178
var (prev, next) = nodesBeforeAndAfter(index: index)
179179
var nodeToCopy = list.head
180-
var newNode:Node?
180+
var newNode: Node?
181181
while let node = nodeToCopy {
182182
newNode = Node(value: node.value)
183183
newNode?.previous = prev

Diff for: Linked List/LinkedList.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public final class LinkedList<T> {
129129
if list.isEmpty { return }
130130
var (prev, next) = nodesBeforeAndAfter(index: index)
131131
var nodeToCopy = list.head
132-
var newNode:Node?
132+
var newNode: Node?
133133
while let node = nodeToCopy {
134134
newNode = Node(value: node.value)
135135
newNode?.previous = prev

Diff for: Red-Black Tree/Red-Black Tree 2.playground/Sources/RBTree.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ private enum RBTColor {
77
public class RBTNode<T: Comparable>: CustomStringConvertible {
88
fileprivate var color: RBTColor = .red
99
public var value: T! = nil
10-
public var right: RBTNode<T>!
11-
public var left: RBTNode<T>!
12-
public var parent: RBTNode<T>!
10+
public var right: RBTNode<T>!
11+
public var left: RBTNode<T>!
12+
public var parent: RBTNode<T>!
1313

1414
public var description: String {
1515
if self.value == nil {
@@ -435,7 +435,7 @@ public class RBTree<T: Comparable>: CustomStringConvertible {
435435
private func property3() {
436436
let bDepth = blackDepth(root: self.root)
437437

438-
let leaves:[RBTNode<T>] = getLeaves(n: self.root)
438+
let leaves: [RBTNode<T>] = getLeaves(n: self.root)
439439

440440
for leaflet in leaves {
441441
var leaf = leaflet

Diff for: Skip-List/SkipList.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ extension SkipList {
283283

284284
extension SkipList {
285285

286-
public func get(key:Key) -> Payload? {
286+
public func get(key: Key) -> Payload? {
287287
return search(key: key)
288288
}
289289
}

Diff for: Topological Sort/Graph.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public class Graph: CustomStringConvertible {
44
private(set) public var adjacencyLists: [Node : [Node]]
55

66
public init() {
7-
adjacencyLists = [Node : [Node]]()
7+
adjacencyLists = [Node: [Node]]()
88
}
99

1010
public func addNode(_ value: Node) -> Node {
@@ -35,7 +35,7 @@ extension Graph {
3535
typealias InDegree = Int
3636

3737
func calculateInDegreeOfNodes() -> [Node : InDegree] {
38-
var inDegrees = [Node : InDegree]()
38+
var inDegrees = [Node: InDegree]()
3939

4040
for (node, _) in adjacencyLists {
4141
inDegrees[node] = 0

Diff for: Topological Sort/Topological Sort.playground/Sources/Graph.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public class Graph: CustomStringConvertible {
44
private(set) public var adjacencyLists: [Node : [Node]]
55

66
public init() {
7-
adjacencyLists = [Node : [Node]]()
7+
adjacencyLists = [Node: [Node]]()
88
}
99

1010
public func addNode(_ value: Node) -> Node {
@@ -35,7 +35,7 @@ extension Graph {
3535
typealias InDegree = Int
3636

3737
func calculateInDegreeOfNodes() -> [Node : InDegree] {
38-
var inDegrees = [Node : InDegree]()
38+
var inDegrees = [Node: InDegree]()
3939

4040
for (node, _) in adjacencyLists {
4141
inDegrees[node] = 0

Diff for: Topological Sort/Topological Sort.playground/Sources/TopologicalSort1.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extension Graph {
2323
return node
2424
})
2525

26-
var visited = [Node : Bool]()
26+
var visited = [Node: Bool]()
2727
for (node, _) in adjacencyLists {
2828
visited[node] = false
2929
}

Diff for: Topological Sort/TopologicalSort1.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extension Graph {
2323
return node
2424
})
2525

26-
var visited = [Node : Bool]()
26+
var visited = [Node: Bool]()
2727
for (node, _) in adjacencyLists {
2828
visited[node] = false
2929
}

0 commit comments

Comments
 (0)