MCPcopy Create free account
hub / github.com/Facets-cloud/flow / sortedWeekly

Function sortedWeekly

internal/stats/report.go:260–271  ·  view source on GitHub ↗
(m map[time.Time]*WeeklyPoint)

Source from the content-addressed store, hash-verified

258}
259
260func sortedWeekly(m map[time.Time]*WeeklyPoint) []WeeklyPoint {
261 out := make([]WeeklyPoint, 0, len(m))
262 for _, wp := range m {
263 out = append(out, *wp)
264 }
265 for i := 1; i < len(out); i++ { // insertion sort by WeekStart asc
266 for j := i; j > 0 && out[j].WeekStart.Before(out[j-1].WeekStart); j-- {
267 out[j], out[j-1] = out[j-1], out[j]
268 }
269 }
270 return out
271}
272
273// countFiles counts files ending in ext inside <base>/*/<sub>/.
274func countFiles(base, sub, ext string) int {

Callers 1

BuildStatsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected