Try:
struct SegmentedArray {
private static let segmentCapacityPowerOf2 = 13
private static let segmentCapacity = 1 <<
SegmentedArray.segmentCapacityPowerOf2
private var offset: Int
private var firstSegments: [[UInt8]]
private var lastSegment: [UInt8]
var count: Int {
Could you file a bug report? bugs.swift.org?
Michael
> On May 9, 2017, at 12:59 AM, Howard Lovatt via swift-users
> wrote:
>
> My mistake. If I create a new array I get the problem. EG:
>
> import Foundation
>
> func elapsed(s: DispatchTime, e: DispatchTime) -> Double {
> return Double(e
My mistake. If I create a new array I get the problem. EG:
import Foundation
func elapsed(s: DispatchTime, e: DispatchTime) -> Double {
return Double(e.uptimeNanoseconds - s.uptimeNanoseconds) / 1_000_000_000
}
let s = 250_000_000
var a = [UInt8]()
a.reserveCapacity(s)
let sa = DispatchTime
I find trimming relative to appending OK on my 6 year old MacBook Pro. EG:
import Foundation
func elapsed(s: DispatchTime, e: DispatchTime) -> Double {
return Double(e.uptimeNanoseconds - s.uptimeNanoseconds) / 1_000_000_000
}
let s = 250_000_000
var a = [UInt8]()
a.reserveCapacity(s)
let s