diff --git a/Example/Sources/Data Generation/Lorem.swift b/Example/Sources/Data Generation/Lorem.swift index fc82d503..1c8c3f6e 100755 --- a/Example/Sources/Data Generation/Lorem.swift +++ b/Example/Sources/Data Generation/Lorem.swift @@ -223,6 +223,10 @@ public extension Array { Shuffle the array in-place using the Fisher-Yates algorithm. */ mutating func shuffle() { + if count == 0 { + return + } + for i in 0..<(count - 1) { let j = Int(arc4random_uniform(UInt32(count - i))) + i if j != i {