@@ -49,7 +49,7 @@ public struct LoggingGenerator<Base: GeneratorType>
49
49
}
50
50
51
51
public mutating func next() -> Base.Element? {
52
- ++ Log.next[selfType]
52
+ Log.next[selfType] += 1
53
53
return base.next()
54
54
}
55
55
@@ -99,14 +99,14 @@ public struct LoggingRangeReplaceableCollection<
99
99
100
100
public init() {
101
101
self.base = Base()
102
- ++ Log.init_[selfType]
102
+ Log.init_[selfType] += 1
103
103
}
104
104
105
105
public init<
106
106
S : SequenceType where S.Generator.Element == Generator.Element
107
107
>(_ elements: S) {
108
108
self.base = Base(elements)
109
- ++ Log.initWithSequence[selfType]
109
+ Log.initWithSequence[selfType] += 1
110
110
}
111
111
112
112
public init(_ base: Base) {
@@ -142,73 +142,73 @@ public struct LoggingRangeReplaceableCollection<
142
142
>(
143
143
subRange: Range<Base.Index>, with newElements: C
144
144
) {
145
- ++ Log.replaceRange[selfType]
145
+ Log.replaceRange[selfType] += 1
146
146
base.replaceRange(subRange, with: newElements)
147
147
}
148
148
149
149
public mutating func append(newElement: Base.Generator.Element) {
150
- ++ Log.append[selfType]
150
+ Log.append[selfType] += 1
151
151
base.append(newElement)
152
152
}
153
153
154
154
public mutating func appendContentsOf<
155
155
S : SequenceType where S.Generator.Element == Base.Generator.Element
156
156
>(newElements: S) {
157
- ++ Log.appendContentsOf[selfType]
157
+ Log.appendContentsOf[selfType] += 1
158
158
base.appendContentsOf(newElements)
159
159
}
160
160
161
161
public mutating func insert(
162
162
newElement: Base.Generator.Element, atIndex i: Base.Index
163
163
) {
164
- ++ Log.insert[selfType]
164
+ Log.insert[selfType] += 1
165
165
base.insert(newElement, atIndex: i)
166
166
}
167
167
168
168
public mutating func removeAtIndex(index: Base.Index) -> Base.Generator.Element {
169
- ++ Log.removeAtIndex[selfType]
169
+ Log.removeAtIndex[selfType] += 1
170
170
return base.removeAtIndex(index)
171
171
}
172
172
173
173
public mutating func _customRemoveLast() -> Base.Generator.Element? {
174
- ++ Log._customRemoveLast[selfType]
174
+ Log._customRemoveLast[selfType] += 1
175
175
return base._customRemoveLast()
176
176
}
177
177
178
178
public mutating func _customRemoveLast(n: Int) -> Bool {
179
- ++ Log._customRemoveLastN[selfType]
179
+ Log._customRemoveLastN[selfType] += 1
180
180
return base._customRemoveLast(n)
181
181
}
182
182
183
183
public mutating func removeFirst() -> Base.Generator.Element {
184
- ++ Log.removeFirst[selfType]
184
+ Log.removeFirst[selfType] += 1
185
185
return base.removeFirst()
186
186
}
187
187
188
188
public mutating func removeFirst(n: Int) {
189
- ++ Log.removeFirstN[selfType]
189
+ Log.removeFirstN[selfType] += 1
190
190
base.removeFirst(n)
191
191
}
192
192
193
193
public mutating func removeRange(subRange: Range<Base.Index>) {
194
- ++ Log.removeRange[selfType]
194
+ Log.removeRange[selfType] += 1
195
195
base.removeRange(subRange)
196
196
}
197
197
198
198
public mutating func removeAll(keepCapacity keepCapacity: Bool) {
199
- ++ Log.removeAll[selfType]
199
+ Log.removeAll[selfType] += 1
200
200
base.removeAll(keepCapacity: keepCapacity)
201
201
}
202
202
203
203
public mutating func reserveCapacity(n: Base.Index.Distance) {
204
- ++ Log.reserveCapacity[selfType]
204
+ Log.reserveCapacity[selfType] += 1
205
205
base.reserveCapacity(n)
206
206
}
207
207
208
208
public mutating func insertContentsOf<
209
209
C : CollectionType where C.Generator.Element == Base.Generator.Element
210
210
>(newElements: C, at i: Base.Index) {
211
- ++ Log.insertContentsOf[selfType]
211
+ Log.insertContentsOf[selfType] += 1
212
212
base.insertContentsOf(newElements, at: i)
213
213
}
214
214
@@ -331,30 +331,30 @@ public struct Logging${Kind}<
331
331
}
332
332
333
333
public func successor() -> Logging${Kind} {
334
- ++ Log.successor[selfType]
334
+ Log.successor[selfType] += 1
335
335
return Logging${Kind}(base.successor())
336
336
}
337
337
338
338
% if Kind == 'BidirectionalIndex' or Kind == 'RandomAccessIndex':
339
339
public func predecessor() -> Logging${Kind}<Base> {
340
- ++ Log.predecessor[selfType]
340
+ Log.predecessor[selfType] += 1
341
341
return Logging${Kind}(base.predecessor())
342
342
}
343
343
% end
344
344
345
345
public func distanceTo(end: Logging${Kind}<Base>) -> Base.Distance {
346
- ++ Log.distanceTo[selfType]
346
+ Log.distanceTo[selfType] += 1
347
347
return base.distanceTo(end.base)
348
348
}
349
349
350
350
public func advancedBy(n: Base.Distance) -> Logging${Kind}<Base> {
351
- ++ Log.advancedBy[selfType]
351
+ Log.advancedBy[selfType] += 1
352
352
return Logging${Kind}(base.advancedBy(n))
353
353
}
354
354
355
355
public func advancedBy(n: Base.Distance, limit: Logging${Kind}<Base>)
356
356
-> Logging${Kind} {
357
- ++ Log.advancedByWithLimit[selfType]
357
+ Log.advancedByWithLimit[selfType] += 1
358
358
return Logging${Kind}(base.advancedBy(n, limit: limit.base))
359
359
}
360
360
}
@@ -376,60 +376,60 @@ public struct Logging${Kind}<Base: ${Kind}Type> : ${Kind}Type, LoggingType {
376
376
377
377
% if Kind == 'Collection' or Kind == 'MutableCollection':
378
378
public var startIndex: Base.Index {
379
- ++ Log.startIndex[selfType]
379
+ Log.startIndex[selfType] += 1
380
380
return base.startIndex
381
381
}
382
382
383
383
public var endIndex: Base.Index {
384
- ++ Log.endIndex[selfType]
384
+ Log.endIndex[selfType] += 1
385
385
return base.endIndex
386
386
}
387
387
388
388
public subscript(position: Base.Index) -> Base.Generator.Element {
389
389
get {
390
- ++ Log.subscriptIndex[selfType]
390
+ Log.subscriptIndex[selfType] += 1
391
391
return base[position]
392
392
}
393
393
% if Kind == 'MutableCollection':
394
394
set {
395
- ++ Log.subscriptIndexSet[selfType]
395
+ Log.subscriptIndexSet[selfType] += 1
396
396
base[position] = newValue
397
397
}
398
398
% end
399
399
}
400
400
401
401
public subscript(bounds: Range<Base.Index>) -> Base.SubSequence {
402
402
get {
403
- ++ Log.subscriptRange[selfType]
403
+ Log.subscriptRange[selfType] += 1
404
404
return base[bounds]
405
405
}
406
406
% if Kind == 'MutableCollection':
407
407
set {
408
- ++ Log.subscriptRangeSet[selfType]
408
+ Log.subscriptRangeSet[selfType] += 1
409
409
base[bounds] = newValue
410
410
}
411
411
% end
412
412
}
413
413
414
414
public var isEmpty: Bool {
415
- ++ Log.isEmpty[selfType]
415
+ Log.isEmpty[selfType] += 1
416
416
return base.isEmpty
417
417
}
418
418
419
419
public var count: Base.Index.Distance {
420
- ++ Log.count[selfType]
420
+ Log.count[selfType] += 1
421
421
return base.count
422
422
}
423
423
424
424
public func _customIndexOfEquatableElement(
425
425
element: Base.Generator.Element
426
426
) -> Base.Index?? {
427
- ++ Log._customIndexOfEquatableElement[selfType]
427
+ Log._customIndexOfEquatableElement[selfType] += 1
428
428
return base._customIndexOfEquatableElement(element)
429
429
}
430
430
431
431
public var first: Base.Generator.Element? {
432
- ++ Log.first[selfType]
432
+ Log.first[selfType] += 1
433
433
return base.first
434
434
}
435
435
% end
@@ -438,65 +438,65 @@ public struct Logging${Kind}<Base: ${Kind}Type> : ${Kind}Type, LoggingType {
438
438
public mutating func _withUnsafeMutableBufferPointerIfSupported<R>(
439
439
@noescape body: (UnsafeMutablePointer<Generator.Element>, Int) throws -> R
440
440
) rethrows -> R? {
441
- ++ Log._withUnsafeMutableBufferPointerIfSupported[selfType]
441
+ Log._withUnsafeMutableBufferPointerIfSupported[selfType] += 1
442
442
let result = try base._withUnsafeMutableBufferPointerIfSupported(body)
443
443
if result != nil {
444
- ++ Log._withUnsafeMutableBufferPointerIfSupportedNonNilReturns[selfType]
444
+ Log._withUnsafeMutableBufferPointerIfSupportedNonNilReturns[selfType] += 1
445
445
}
446
446
return result
447
447
}
448
448
% end
449
449
450
450
public func generate() -> LoggingGenerator<Base.Generator> {
451
- ++ Log.generate[selfType]
451
+ Log.generate[selfType] += 1
452
452
return LoggingGenerator(base.generate())
453
453
}
454
454
455
455
public func underestimateCount() -> Int {
456
- ++ Log.underestimateCount[selfType]
456
+ Log.underestimateCount[selfType] += 1
457
457
return base.underestimateCount()
458
458
}
459
459
460
460
public func forEach(
461
461
@noescape body: (Base.Generator.Element) throws -> Void
462
462
) rethrows {
463
- ++ Log.forEach[selfType]
463
+ Log.forEach[selfType] += 1
464
464
try base.forEach(body)
465
465
}
466
466
467
467
@warn_unused_result
468
468
public func map<T>(
469
469
@noescape transform: (Base.Generator.Element) throws -> T
470
470
) rethrows -> [T] {
471
- ++ Log.map[selfType]
471
+ Log.map[selfType] += 1
472
472
return try base.map(transform)
473
473
}
474
474
475
475
@warn_unused_result
476
476
public func filter(
477
477
@noescape includeElement: (Base.Generator.Element) throws -> Bool
478
478
) rethrows -> [Base.Generator.Element] {
479
- ++ Log.filter[selfType]
479
+ Log.filter[selfType] += 1
480
480
return try base.filter(includeElement)
481
481
}
482
482
483
483
public func dropFirst(n: Int) -> Base.SubSequence {
484
- ++ Log.dropFirst[selfType]
484
+ Log.dropFirst[selfType] += 1
485
485
return base.dropFirst(n)
486
486
}
487
487
488
488
public func dropLast(n: Int) -> Base.SubSequence {
489
- ++ Log.dropLast[selfType]
489
+ Log.dropLast[selfType] += 1
490
490
return base.dropLast(n)
491
491
}
492
492
493
493
public func prefix(maxLength: Int) -> Base.SubSequence {
494
- ++ Log.prefix[selfType]
494
+ Log.prefix[selfType] += 1
495
495
return base.prefix(maxLength)
496
496
}
497
497
498
498
public func suffix(maxLength: Int) -> Base.SubSequence {
499
- ++ Log.suffix[selfType]
499
+ Log.suffix[selfType] += 1
500
500
return base.suffix(maxLength)
501
501
}
502
502
@@ -505,25 +505,25 @@ public struct Logging${Kind}<Base: ${Kind}Type> : ${Kind}Type, LoggingType {
505
505
allowEmptySlices: Bool = false,
506
506
@noescape isSeparator: (Base.Generator.Element) throws -> Bool
507
507
) rethrows -> [Base.SubSequence] {
508
- ++ Log.split[selfType]
508
+ Log.split[selfType] += 1
509
509
return try base.split(maxSplit, allowEmptySlices: allowEmptySlices,
510
510
isSeparator: isSeparator)
511
511
}
512
512
513
513
% if Kind == 'Collection' or Kind == 'MutableCollection':
514
514
515
515
public func prefixUpTo(end: Index) -> Base.SubSequence {
516
- ++ Log.prefixUpTo[selfType]
516
+ Log.prefixUpTo[selfType] += 1
517
517
return base.prefixUpTo(end)
518
518
}
519
519
520
520
public func suffixFrom(start: Index) -> Base.SubSequence {
521
- ++ Log.suffixFrom[selfType]
521
+ Log.suffixFrom[selfType] += 1
522
522
return base.suffixFrom(start)
523
523
}
524
524
525
525
public func prefixThrough(position: Index) -> Base.SubSequence {
526
- ++ Log.prefixThrough[selfType]
526
+ Log.prefixThrough[selfType] += 1
527
527
return base.prefixThrough(position)
528
528
}
529
529
@@ -532,7 +532,7 @@ public struct Logging${Kind}<Base: ${Kind}Type> : ${Kind}Type, LoggingType {
532
532
public func _customContainsEquatableElement(
533
533
element: Base.Generator.Element
534
534
) -> Bool? {
535
- ++ Log._customContainsEquatableElement[selfType]
535
+ Log._customContainsEquatableElement[selfType] += 1
536
536
return base._customContainsEquatableElement(element)
537
537
}
538
538
@@ -542,22 +542,22 @@ public struct Logging${Kind}<Base: ${Kind}Type> : ${Kind}Type, LoggingType {
542
542
public func _preprocessingPass<R>(
543
543
preprocess: (Logging${Kind})->R
544
544
) -> R? {
545
- ++ Log._preprocessingPass[selfType]
545
+ Log._preprocessingPass[selfType] += 1
546
546
return base._preprocessingPass { _ in preprocess(self) }
547
547
}
548
548
549
549
/// Create a native array buffer containing the elements of `self`,
550
550
/// in the same order.
551
551
public func _copyToNativeArrayBuffer()
552
552
-> _ContiguousArrayBuffer<Base.Generator.Element> {
553
- ++ Log._copyToNativeArrayBuffer[selfType]
553
+ Log._copyToNativeArrayBuffer[selfType] += 1
554
554
return base._copyToNativeArrayBuffer()
555
555
}
556
556
557
557
/// Copy a Sequence into an array.
558
558
public func _initializeTo(ptr: UnsafeMutablePointer<Base.Generator.Element>)
559
559
-> UnsafeMutablePointer<Base.Generator.Element> {
560
- ++ Log._initializeTo[selfType]
560
+ Log._initializeTo[selfType] += 1
561
561
return base._initializeTo(ptr)
562
562
}
563
563
0 commit comments