Skip to content

Commit 9f4651a

Browse files
aalemayhuparkera
authored andcommitted
[gardening]: remove unnecessary semicolons (#316)
No intended functionality change.
1 parent 848645c commit 9f4651a

14 files changed

+73
-73
lines changed

Foundation/FoundationErrors.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -207,39 +207,39 @@ public extension NSCocoaError {
207207
}
208208

209209
public var isCoderError: Bool {
210-
return rawValue >= 4864 && rawValue <= 4991;
210+
return rawValue >= 4864 && rawValue <= 4991
211211
}
212212

213213
public var isExecutableError: Bool {
214-
return rawValue >= 3584 && rawValue <= 3839;
214+
return rawValue >= 3584 && rawValue <= 3839
215215
}
216216

217217
public var isFileError: Bool {
218-
return rawValue >= 0 && rawValue <= 1023;
218+
return rawValue >= 0 && rawValue <= 1023
219219
}
220220

221221
public var isFormattingError: Bool {
222-
return rawValue >= 2048 && rawValue <= 2559;
222+
return rawValue >= 2048 && rawValue <= 2559
223223
}
224224

225225
public var isPropertyListError: Bool {
226-
return rawValue >= 3840 && rawValue <= 4095;
226+
return rawValue >= 3840 && rawValue <= 4095
227227
}
228228

229229
public var isUbiquitousFileError: Bool {
230-
return rawValue >= 4352 && rawValue <= 4607;
230+
return rawValue >= 4352 && rawValue <= 4607
231231
}
232232

233233
public var isUserActivityError: Bool {
234-
return rawValue >= 4608 && rawValue <= 4863;
234+
return rawValue >= 4608 && rawValue <= 4863
235235
}
236236

237237
public var isValidationError: Bool {
238-
return rawValue >= 1024 && rawValue <= 2047;
238+
return rawValue >= 1024 && rawValue <= 2047
239239
}
240240

241241
public var isXPCConnectionError: Bool {
242-
return rawValue >= 4096 && rawValue <= 4224;
242+
return rawValue >= 4096 && rawValue <= 4224
243243
}
244244
}
245245

Foundation/NSCalendar.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public class NSCalendar : NSObject, NSCopying, NSSecureCoding {
148148
aCoder.encodeObject(self.locale, forKey: "NS.locale")
149149
aCoder.encodeInteger(self.firstWeekday, forKey: "NS.firstwkdy")
150150
aCoder.encodeInteger(self.minimumDaysInFirstWeek, forKey: "NS.mindays")
151-
aCoder.encodeObject(self._startDate, forKey: "NS.gstartdate");
151+
aCoder.encodeObject(self._startDate, forKey: "NS.gstartdate")
152152
} else {
153153
NSUnimplemented()
154154
}
@@ -368,7 +368,7 @@ public class NSCalendar : NSObject, NSCopying, NSSecureCoding {
368368
if r.location == kCFNotFound {
369369
return NSMakeRange(NSNotFound, NSNotFound)
370370
}
371-
return NSMakeRange(r.location, r.length);
371+
return NSMakeRange(r.location, r.length)
372372
}
373373

374374
public func ordinalityOfUnit(_ smaller: NSCalendarUnit, inUnit larger: NSCalendarUnit, forDate date: NSDate) -> Int {

Foundation/NSKeyedArchiver.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public class NSKeyedArchiver : NSCoder {
196196
kCFPropertyListOpenStepFormat, 0, nil) > 0
197197
}
198198

199-
return success;
199+
return success
200200
}
201201

202202
private func _writeBinaryData(_ plist : NSDictionary) -> Bool {
@@ -205,7 +205,7 @@ public class NSKeyedArchiver : NSCoder {
205205

206206
public func finishEncoding() {
207207
if _flags.contains(ArchiverFlags.FinishedEncoding) {
208-
return;
208+
return
209209
}
210210

211211
var plist = Dictionary<String, Any>()

Foundation/NSKeyedUnarchiver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ public class NSKeyedUnarchiver : NSCoder {
568568
*/
569569
public func finishDecoding() {
570570
if _flags.contains(UnarchiverFlags.FinishedDecoding) {
571-
return;
571+
return
572572
}
573573

574574
if let unwrappedDelegate = self.delegate {

Foundation/NSRegularExpression.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ extension NSRegularExpression {
271271
var length = str.length
272272
while (orderOfMagnitude < numberOfRanges && numberOfDigits < 20) {
273273
numberOfDigits += 1
274-
orderOfMagnitude *= 10;
274+
orderOfMagnitude *= 10
275275
}
276276
while range.length > 0 {
277277
var c = str.characterAtIndex(range.location)

Foundation/NSScanner.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ internal struct _NSStringBuffer {
9191
stringLen = end
9292

9393
if _stringLoc < stringLen {
94-
bufferLen = min(32, stringLen - _stringLoc);
94+
bufferLen = min(32, stringLen - _stringLoc)
9595
let range = NSMakeRange(_stringLoc, bufferLen)
9696
bufferLoc = 1
9797
buffer.withUnsafeMutableBufferPointer({ (ptr: inout UnsafeMutableBufferPointer<unichar>) -> Void in
@@ -111,7 +111,7 @@ internal struct _NSStringBuffer {
111111
stringLen = end
112112

113113
if _stringLoc < stringLen {
114-
bufferLen = min(32, stringLen - _stringLoc);
114+
bufferLen = min(32, stringLen - _stringLoc)
115115
let range = NSMakeRange(_stringLoc, bufferLen)
116116
bufferLoc = 1
117117
buffer.withUnsafeMutableBufferPointer({ (ptr: inout UnsafeMutableBufferPointer<unichar>) -> Void in
@@ -134,7 +134,7 @@ internal struct _NSStringBuffer {
134134
}
135135

136136
mutating func fill() {
137-
bufferLen = min(32, stringLen - _stringLoc);
137+
bufferLen = min(32, stringLen - _stringLoc)
138138
let range = NSMakeRange(_stringLoc, bufferLen)
139139
buffer.withUnsafeMutableBufferPointer({ (ptr: inout UnsafeMutableBufferPointer<unichar>) -> Void in
140140
string.getCharacters(ptr.baseAddress!, range: range)
@@ -271,7 +271,7 @@ private func numericOrHexValue(_ ch: unichar) -> Int {
271271
} else if (ch >= unichar(unicodeScalarLiteral: "a") && ch <= unichar(unicodeScalarLiteral: "f")) {
272272
return Int(ch) + 10 - Int(unichar(unicodeScalarLiteral: "a"))
273273
} else {
274-
return -1;
274+
return -1
275275
}
276276
}
277277

Foundation/NSXMLDTDNode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public class NSXMLDTDNode : NSXMLNode {
117117
return .NSXMLEntityParsedKind
118118

119119
default:
120-
fatalError("Invalid entity declaration type");
120+
fatalError("Invalid entity declaration type")
121121
}
122122

123123
case _kCFXMLDTDNodeTypeAttribute:

Foundation/NSXMLDocument.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public class NSXMLDocument : NSXMLNode {
162162
*/
163163
public var documentContentKind: NSXMLDocumentContentKind {
164164
get {
165-
let properties = _CFXMLDocProperties(_xmlDoc);
165+
let properties = _CFXMLDocProperties(_xmlDoc)
166166

167167
if properties & Int32(_kCFXMLDocTypeHTML) != 0 {
168168
return .HTMLKind
@@ -197,7 +197,7 @@ public class NSXMLDocument : NSXMLNode {
197197
*/
198198
/*@NSCopying*/ public var DTD: NSXMLDTD? {
199199
get {
200-
return NSXMLDTD._objectNodeForNode(_CFXMLDocDTD(_xmlDoc)!);
200+
return NSXMLDTD._objectNodeForNode(_CFXMLDocDTD(_xmlDoc)!)
201201
}
202202
set {
203203
if let currDTD = _CFXMLDocDTD(_xmlDoc) {

Foundation/NSXMLNode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ public class NSXMLNode : NSObject, NSCopying {
717717
*/
718718
public func nodesForXPath(_ xpath: String) throws -> [NSXMLNode] {
719719
guard let nodes = _CFXMLNodesForXPath(_xmlNode, xpath) else {
720-
NSUnimplemented();
720+
NSUnimplemented()
721721
}
722722

723723
var result: [NSXMLNode] = []

TestFoundation/TestNSArray.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ class TestNSArray : XCTestCase {
380380
return l < r ? .OrderedAscending : (l > r ? .OrderedSame : .OrderedDescending)
381381
}
382382

383-
XCTAssertEqual(mutableInput.map { ($0 as! NSNumber).integerValue}, expectedNumbers);
383+
XCTAssertEqual(mutableInput.map { ($0 as! NSNumber).integerValue}, expectedNumbers)
384384

385385
// check that it works in the way self.sortWithOptions([], usingComparator: cmptr) does
386386
let inputStrings = ["this", "is", "a", "test", "of", "sort", "with", "strings"]

TestFoundation/TestNSNotificationQueue.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class TestNSNotificationQueue : XCTestCase {
130130
let queue = NSNotificationQueue.defaultQueue()
131131
queue.enqueueNotification(notification, postingStyle: .PostASAP)
132132

133-
scheduleTimer(withInterval: 0.001); // run timer trigger the notifications
133+
scheduleTimer(withInterval: 0.001) // run timer trigger the notifications
134134
XCTAssertEqual(numberOfCalls, 1)
135135
}
136136

@@ -147,7 +147,7 @@ class TestNSNotificationQueue : XCTestCase {
147147
queue.enqueueNotification(notification, postingStyle: .PostASAP)
148148
queue.enqueueNotification(notification, postingStyle: .PostASAP)
149149

150-
scheduleTimer(withInterval: 0.001);
150+
scheduleTimer(withInterval: 0.001)
151151
XCTAssertEqual(numberOfCalls, 1)
152152
}
153153

@@ -176,7 +176,7 @@ class TestNSNotificationQueue : XCTestCase {
176176
queue.enqueueNotification(notification2, postingStyle: .PostASAP, coalesceMask: .CoalescingOnName, forModes: nil)
177177
// #5
178178
queue.enqueueNotification(notification1, postingStyle: .PostASAP, coalesceMask: .CoalescingOnSender, forModes: nil)
179-
scheduleTimer(withInterval: 0.001);
179+
scheduleTimer(withInterval: 0.001)
180180
// check that we received notifications #4 and #5
181181
XCTAssertEqual(numberOfNameCoalescingCalls, 1)
182182
XCTAssertEqual(numberOfObjectCoalescingCalls, 1)
@@ -194,7 +194,7 @@ class TestNSNotificationQueue : XCTestCase {
194194
}
195195
NSNotificationQueue.defaultQueue().enqueueNotification(notification, postingStyle: .PostWhenIdle)
196196
// add a timer to wakeup the runloop, process the timer and call the observer awaiting for any input sources/timers
197-
scheduleTimer(withInterval: 0.001);
197+
scheduleTimer(withInterval: 0.001)
198198
XCTAssertEqual(numberOfCalls, 1)
199199
}
200200

TestFoundation/TestNSNumber.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class TestNSNumber : XCTestCase {
7474
XCTAssertEqual(NSNumber(char: Int8(0)).unsignedIntValue, UInt32(0))
7575
XCTAssertEqual(NSNumber(char: Int8(0)).longLongValue, Int64(0))
7676
XCTAssertEqual(NSNumber(char: Int8(0)).unsignedLongLongValue, UInt64(0))
77-
XCTAssertEqual(NSNumber(char: Int8(-37)).boolValue, true);
77+
XCTAssertEqual(NSNumber(char: Int8(-37)).boolValue, true)
7878
XCTAssertEqual(NSNumber(char: Int8(-37)).charValue, Int8(-37))
7979
#if !(os(Linux) && arch(arm))
8080
// Linux/arm chars are unsigned, so Int8 in Swift, until this issue is resolved, these tests will always fail.
@@ -184,7 +184,7 @@ class TestNSNumber : XCTestCase {
184184
XCTAssertEqual(NSNumber(short: Int16(0)).unsignedIntValue, UInt32(0))
185185
XCTAssertEqual(NSNumber(short: Int16(0)).longLongValue, Int64(0))
186186
XCTAssertEqual(NSNumber(short: Int16(0)).unsignedLongLongValue, UInt64(0))
187-
XCTAssertEqual(NSNumber(short: Int16(-37)).boolValue, true);
187+
XCTAssertEqual(NSNumber(short: Int16(-37)).boolValue, true)
188188
XCTAssertEqual(NSNumber(short: Int16(-37)).charValue, Int8(-37))
189189
XCTAssertEqual(NSNumber(short: Int16(-37)).shortValue, Int16(-37))
190190
XCTAssertEqual(NSNumber(short: Int16(-37)).intValue, Int32(-37))
@@ -218,7 +218,7 @@ class TestNSNumber : XCTestCase {
218218
XCTAssertEqual(NSNumber(float: Float(0)).unsignedIntValue, UInt32(0))
219219
XCTAssertEqual(NSNumber(float: Float(0)).longLongValue, Int64(0))
220220
XCTAssertEqual(NSNumber(float: Float(0)).unsignedLongLongValue, UInt64(0))
221-
XCTAssertEqual(NSNumber(float: Float(-37)).boolValue, true);
221+
XCTAssertEqual(NSNumber(float: Float(-37)).boolValue, true)
222222
XCTAssertEqual(NSNumber(float: Float(-37)).charValue, Int8(-37))
223223
XCTAssertEqual(NSNumber(float: Float(-37)).shortValue, Int16(-37))
224224
XCTAssertEqual(NSNumber(float: Float(-37)).intValue, Int32(-37))
@@ -250,7 +250,7 @@ class TestNSNumber : XCTestCase {
250250
XCTAssertEqual(NSNumber(double: Double(0)).unsignedIntValue, UInt32(0))
251251
XCTAssertEqual(NSNumber(double: Double(0)).longLongValue, Int64(0))
252252
XCTAssertEqual(NSNumber(double: Double(0)).unsignedLongLongValue, UInt64(0))
253-
XCTAssertEqual(NSNumber(double: Double(-37)).boolValue, true);
253+
XCTAssertEqual(NSNumber(double: Double(-37)).boolValue, true)
254254
XCTAssertEqual(NSNumber(double: Double(-37)).charValue, Int8(-37))
255255
XCTAssertEqual(NSNumber(double: Double(-37)).shortValue, Int16(-37))
256256
XCTAssertEqual(NSNumber(double: Double(-37)).intValue, Int32(-37))

0 commit comments

Comments
 (0)