Skip to content

Commit

Permalink
refactor: type/maputil: rename Records.Sum() from Records.Total()
Browse files Browse the repository at this point in the history
  • Loading branch information
grokify committed Dec 25, 2024
1 parent 431f60f commit 329b541
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions type/maputil/map_string_int.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ func (rs Records) String(sep string) string {
return strings.Join(recs, sep)
}

func (rs Records) Total() int {
total := 0
func (rs Records) Sum() int {
var total int
for _, rec := range rs {
total += rec.Value
}
Expand All @@ -149,7 +149,7 @@ func (rs Records) Markdown(prefix, sep string, countFirst, addTotal bool) string
}
}
if addTotal {
total := rs.Total()
total := rs.Sum()
if countFirst {
lines = append(lines, prefix+strconv.Itoa(total)+sep+"Total")
} else {
Expand Down

0 comments on commit 329b541

Please sign in to comment.