return b
}
if max <= 1 {
- b.Norm = 0.8 // Profile is in"set" mode; we want a heat map. Use cov8 in the CSS.
+ b.Norm = 0.8 // Profile is in "set" mode; we want a heat map. Use cov8 in the CSS.
} else if count > 0 {
b.Norm = math.Log(float64(count)) / divisor
}
func (b boundariesByPos) Swap(i, j int) { b[i], b[j] = b[j], b[i] }
func (b boundariesByPos) Less(i, j int) bool {
if b[i].Offset == b[j].Offset {
- return !b[i].Start && b[j].Start
+ // Boundaries at the same offset should be ordered Start < !Start.
+ // They represent empty sections of code (e.g. a switch/select clause
+ // without a body).
+ return b[i].Start && !b[j].Start
}
return b[i].Offset < b[j].Offset
}