mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2025-01-09 14:20:48 +00:00
remove lineBytes
This commit is contained in:
parent
fde954f97c
commit
f7534c78d1
@ -19,16 +19,16 @@ func ParseLines(r io.Reader) ([]*machine.Machine, error) {
|
||||
|
||||
scanner := bufio.NewScanner(r)
|
||||
for scanner.Scan() {
|
||||
lineBytes := scanner.Bytes()
|
||||
if len(lineBytes) == 0 {
|
||||
line := scanner.Text()
|
||||
if len(line) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
var m []string
|
||||
switch line := string(lineBytes); {
|
||||
case reButton.Match(lineBytes):
|
||||
switch line := line; {
|
||||
case reButton.MatchString(line):
|
||||
m = reButton.FindStringSubmatch(line)
|
||||
case rePrize.Match(lineBytes):
|
||||
case rePrize.MatchString(line):
|
||||
m = rePrize.FindStringSubmatch(line)
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ func ParseLines(r io.Reader) ([]*machine.Machine, error) {
|
||||
return machines, nil
|
||||
}
|
||||
|
||||
func mustConv(s string) int {
|
||||
func MustConv(s string) int {
|
||||
n, err := strconv.Atoi(s)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
Loading…
Reference in New Issue
Block a user