• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

earthboundkid / bytemap / 9753565529

02 Jul 2024 01:34AM UTC coverage: 77.473%. First build
9753565529

push

github

web-flow
Fix URL; add Go 1.23 iterators; update benchmarks (#2)

22 of 26 new or added lines in 2 files covered. (84.62%)

282 of 364 relevant lines covered (77.47%)

1255910.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.62
/float_iter.go
1
//go:build goexperiment.rangefunc || go1.23
2

3
package bytemap
4

5
import (
6
        "cmp"
7
        "iter"
8
        "slices"
9
)
10

11
// MostCommon returns a sequence of characters and counts for m
12
// from highest count to lowest.
13
func (m *Float) MostCommon() iter.Seq2[byte, float64] {
1✔
14
        return func(yield func(byte, float64) bool) {
2✔
15
                freqs := make([]byte, Len)
1✔
16
                for i := range freqs {
257✔
17
                        freqs[i] = byte(i)
256✔
18
                }
256✔
19
                slices.SortStableFunc(freqs[:], func(a, b byte) int {
1,416✔
20
                        return cmp.Compare(m[b], m[a])
1,415✔
21
                })
1,415✔
22
                for _, c := range freqs {
257✔
23
                        if !yield(c, m[c]) {
256✔
NEW
24
                                return
×
NEW
25
                        }
×
26
                }
27
        }
28
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc