We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bfc2468 commit 000cd70Copy full SHA for 000cd70
Foundation/NSJSONSerialization.swift
@@ -372,23 +372,7 @@ private struct JSONDeserializer {
372
}
373
374
//MARK: - Number parsing
375
- static let numberScalars = [
376
- UnicodeScalar(0x2E), // .
377
- UnicodeScalar(0x30), // 0
378
- UnicodeScalar(0x31), // 1
379
- UnicodeScalar(0x32), // 2
380
- UnicodeScalar(0x33), // 3
381
- UnicodeScalar(0x34), // 4
382
- UnicodeScalar(0x35), // 5
383
- UnicodeScalar(0x36), // 6
384
- UnicodeScalar(0x37), // 7
385
- UnicodeScalar(0x38), // 8
386
- UnicodeScalar(0x39), // 9
387
- UnicodeScalar(0x65), // e
388
- UnicodeScalar(0x45), // E
389
- UnicodeScalar(0x2B), // +
390
- UnicodeScalar(0x2D), // -
391
- ]
+ static let numberScalars = ".+-0123456789eE".unicodeScalars
392
static func parseNumber(input: UnicodeParser) throws -> (AnyObject, UnicodeParser)? {
393
let view = input.view
394
let endIndex = view.endIndex
0 commit comments