remove lineBytes

This commit is contained in:
onyx-and-iris 2024-12-13 14:47:56 +00:00
parent fde954f97c
commit f7534c78d1

View File

@ -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)