remove extraneous call to TrimSuffix
This commit is contained in:
parent
0f15711b6a
commit
dd8eb8c1f8
@ -31,7 +31,7 @@ func parseLine(s string) (string, map[string]int) {
|
|||||||
result := map[string]int{}
|
result := map[string]int{}
|
||||||
for _, b := range contained {
|
for _, b := range contained {
|
||||||
// strip off the bags?\.? and split on spaces
|
// strip off the bags?\.? and split on spaces
|
||||||
innerBag := strings.Split(strings.TrimSuffix(strings.TrimRight(b, "s."), " bag"), " ")
|
innerBag := strings.Split(strings.TrimRight(b, "bags."), " ")
|
||||||
// parse the count
|
// parse the count
|
||||||
i, _ := strconv.Atoi(innerBag[0])
|
i, _ := strconv.Atoi(innerBag[0])
|
||||||
result[innerBag[1]+" "+innerBag[2]] = i
|
result[innerBag[1]+" "+innerBag[2]] = i
|
||||||
|
Loading…
Reference in New Issue
Block a user