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 3741af3 commit 2d6c792Copy full SHA for 2d6c792
Sources/Prometheus/MetricTypes/Histogram.swift
@@ -39,12 +39,7 @@ public struct Buckets: ExpressibleByArrayLiteral {
39
/// - count: Amount of buckets to generate, should be larger than zero. The +Inf bucket is not included in this count.
40
public static func linear(start: Double, width: Double, count: Int) -> Buckets {
41
assert(count >= 1, "Bucket.linear needs a count larger than 1")
42
- var arr = [Double]()
43
- var s = start
44
- for _ in 0..<count {
45
- arr.append(s)
46
- s += width
47
- }
+ let arr = (0..<count).map { Double(start) + Double($0) * Double(width) }
48
return Buckets(arr)
49
}
50
0 commit comments