Skip to content

Commit 7bd0a9f

Browse files
author
Enrico Granata
committed
Code review feedback; proper spacing of function arguments
1 parent 73ddecc commit 7bd0a9f

File tree

1 file changed

+41
-36
lines changed

1 file changed

+41
-36
lines changed

stdlib/public/core/PrintForDebugger.swift

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ public enum _PrintForDebugger {
5555
}
5656
}
5757

58-
static func asStringRepresentation(value: Any?,
59-
mirror: Mirror,
60-
count: Int) -> String? {
58+
static func asStringRepresentation(
59+
value: Any?,
60+
mirror: Mirror,
61+
count: Int) -> String? {
6162
let ds = mirror.displayStyle ?? .`struct`
6263
switch ds {
6364
case .optional:
@@ -122,9 +123,10 @@ public enum _PrintForDebugger {
122123
}
123124

124125

125-
static func shouldExpand(mirror: Mirror,
126-
collectionStatus: CollectionStatus,
127-
isRoot: Bool) -> Bool {
126+
static func shouldExpand(
127+
mirror: Mirror,
128+
collectionStatus: CollectionStatus,
129+
isRoot: Bool) -> Bool {
128130
if isRoot || collectionStatus.isCollection { return true }
129131
let count = Int(mirror.children.count)
130132
if count > 0 { return true }
@@ -214,16 +216,17 @@ public enum _PrintForDebugger {
214216
var printedElements = 0
215217

216218
if let sc = mirror.superclassMirror {
217-
printForDebuggerImpl(value: nil,
218-
mirror: sc,
219-
name: "super",
220-
indent: indent + 2,
221-
maxDepth: maxDepth - 1,
222-
isRoot: false,
223-
parentCollectionStatus: .NotACollection,
224-
refsAlreadySeen: &refsAlreadySeen,
225-
maxItemCounter: &maxItemCounter,
226-
targetStream: &targetStream)
219+
printForDebuggerImpl(
220+
value: nil,
221+
mirror: sc,
222+
name: "super",
223+
indent: indent + 2,
224+
maxDepth: maxDepth - 1,
225+
isRoot: false,
226+
parentCollectionStatus: .NotACollection,
227+
refsAlreadySeen: &refsAlreadySeen,
228+
maxItemCounter: &maxItemCounter,
229+
targetStream: &targetStream)
227230
}
228231

229232
for (optionalName,child) in mirror.children {
@@ -245,16 +248,17 @@ public enum _PrintForDebugger {
245248
return
246249
}
247250

248-
printForDebuggerImpl(value: child,
249-
mirror: Mirror(reflecting: child),
250-
name: childName,
251-
indent: indent + 2,
252-
maxDepth: maxDepth - 1,
253-
isRoot: false,
254-
parentCollectionStatus: collectionStatus,
255-
refsAlreadySeen: &refsAlreadySeen,
256-
maxItemCounter: &maxItemCounter,
257-
targetStream: &targetStream)
251+
printForDebuggerImpl(
252+
value: child,
253+
mirror: Mirror(reflecting: child),
254+
name: childName,
255+
indent: indent + 2,
256+
maxDepth: maxDepth - 1,
257+
isRoot: false,
258+
parentCollectionStatus: collectionStatus,
259+
refsAlreadySeen: &refsAlreadySeen,
260+
maxItemCounter: &maxItemCounter,
261+
targetStream: &targetStream)
258262
printedElements += 1
259263
}
260264
}
@@ -277,16 +281,17 @@ public enum _PrintForDebugger {
277281
var refs = Set<ObjectIdentifier>()
278282
var targetStream = StringOutput()
279283

280-
printForDebuggerImpl(value: value,
281-
mirror: Mirror(reflecting: value),
282-
name: nil,
283-
indent: 0,
284-
maxDepth: maxItemCounter,
285-
isRoot: true,
286-
parentCollectionStatus: .NotACollection,
287-
refsAlreadySeen: &refs,
288-
maxItemCounter: &maxItemCounter,
289-
targetStream: &targetStream)
284+
printForDebuggerImpl(
285+
value: value,
286+
mirror: Mirror(reflecting: value),
287+
name: nil,
288+
indent: 0,
289+
maxDepth: maxItemCounter,
290+
isRoot: true,
291+
parentCollectionStatus: .NotACollection,
292+
refsAlreadySeen: &refs,
293+
maxItemCounter: &maxItemCounter,
294+
targetStream: &targetStream)
290295

291296
return targetStream.data
292297
}

0 commit comments

Comments
 (0)