var documentIDs = Array(repeating: 0 as SKDocumentID, count: limit) _ = SKSearchFindMatches(CFIndex(limit), &documentIDs, &foundCount) for i in 0..<Int(foundCount) { loadDocument(id: documentIDs[i]) }
var documentIDs = Array(repeating: 0 as SKDocumentID, count: limit) _ = SKSearchFindMatches(CFIndex(limit), &documentIDs, &foundCount) for i in 0..<Int(foundCount) { loadDocument(id: documentIDs[i]) }
var documentIDs: [SKDocumentID] = [] documentIDs.reserveCapacity(limit) _ = SKSearchFindMatches(CFIndex(limit), &documentIDs, &foundCount) for i in 0..<Int(foundCount) { loadDocument(id: documentIDs[i]) } won’t work
var documentIDs = Array(repeating: 0 as SKDocumentID, count: limit) _ = SKSearchFindMatches(CFIndex(limit), &documentIDs, &foundCount) for i in 0..<Int(foundCount) { loadDocument(id: documentIDs[i]) }
{ return } array.withUnsafeMutableBufferPointer { buffer in for n in 1..<buffer.count { for i in 1...(buffer.count - n) { if buffer[i - 1] > buffer[i] { swap(&buffer[i - 1], &buffer[i]) } } } } }