|
8 | 8 | 63: hist := make([]int, 7) //gdb-opt=(dx/O,dy/O) // TODO sink is missing if this code is in 'test' instead of 'main'
|
9 | 9 | 64: var reader io.Reader = strings.NewReader(cannedInput) //gdb-dbg=(hist/A) // TODO cannedInput/A is missing if this code is in 'test' instead of 'main'
|
10 | 10 | 65: if len(os.Args) > 1 {
|
| 11 | +73: scanner := bufio.NewScanner(reader) |
11 | 12 | 74: for scanner.Scan() { //gdb-opt=(scanner/A)
|
| 13 | +75: s := scanner.Text() |
12 | 14 | 76: i, err := strconv.ParseInt(s, 10, 64)
|
13 | 15 | 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
|
14 | 16 | 81: hist = ensure(int(i), hist)
|
15 | 17 | 82: hist[int(i)]++
|
16 | 18 | 74: for scanner.Scan() { //gdb-opt=(scanner/A)
|
| 19 | +75: s := scanner.Text() |
17 | 20 | 76: i, err := strconv.ParseInt(s, 10, 64)
|
18 | 21 | 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
|
19 | 22 | 81: hist = ensure(int(i), hist)
|
20 | 23 | 82: hist[int(i)]++
|
21 | 24 | 74: for scanner.Scan() { //gdb-opt=(scanner/A)
|
| 25 | +75: s := scanner.Text() |
22 | 26 | 76: i, err := strconv.ParseInt(s, 10, 64)
|
23 | 27 | 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
|
24 | 28 | 81: hist = ensure(int(i), hist)
|
25 | 29 | 82: hist[int(i)]++
|
26 | 30 | 74: for scanner.Scan() { //gdb-opt=(scanner/A)
|
| 31 | +75: s := scanner.Text() |
27 | 32 | 76: i, err := strconv.ParseInt(s, 10, 64)
|
28 | 33 | 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
|
29 | 34 | 81: hist = ensure(int(i), hist)
|
30 | 35 | 82: hist[int(i)]++
|
31 | 36 | 74: for scanner.Scan() { //gdb-opt=(scanner/A)
|
| 37 | +75: s := scanner.Text() |
32 | 38 | 76: i, err := strconv.ParseInt(s, 10, 64)
|
33 | 39 | 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
|
34 | 40 | 81: hist = ensure(int(i), hist)
|
35 | 41 | 82: hist[int(i)]++
|
36 | 42 | 74: for scanner.Scan() { //gdb-opt=(scanner/A)
|
| 43 | +75: s := scanner.Text() |
37 | 44 | 76: i, err := strconv.ParseInt(s, 10, 64)
|
38 | 45 | 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
|
39 | 46 | 81: hist = ensure(int(i), hist)
|
40 | 47 | 82: hist[int(i)]++
|
41 | 48 | 74: for scanner.Scan() { //gdb-opt=(scanner/A)
|
| 49 | +75: s := scanner.Text() |
42 | 50 | 76: i, err := strconv.ParseInt(s, 10, 64)
|
43 | 51 | 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
|
44 | 52 | 81: hist = ensure(int(i), hist)
|
45 | 53 | 82: hist[int(i)]++
|
46 | 54 | 74: for scanner.Scan() { //gdb-opt=(scanner/A)
|
| 55 | +75: s := scanner.Text() |
47 | 56 | 76: i, err := strconv.ParseInt(s, 10, 64)
|
48 | 57 | 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
|
49 | 58 | 81: hist = ensure(int(i), hist)
|
50 | 59 | 82: hist[int(i)]++
|
51 | 60 | 74: for scanner.Scan() { //gdb-opt=(scanner/A)
|
| 61 | +75: s := scanner.Text() |
52 | 62 | 76: i, err := strconv.ParseInt(s, 10, 64)
|
53 | 63 | 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
|
54 | 64 | 81: hist = ensure(int(i), hist)
|
|
60 | 70 | 87: if a == 0 { //gdb-opt=(a,n,t)
|
61 | 71 | 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
|
62 | 72 | 91: n += a
|
| 73 | +92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) |
63 | 74 | 90: t += i * a
|
64 | 75 | 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
|
65 | 76 | 86: for i, a := range hist {
|
66 | 77 | 87: if a == 0 { //gdb-opt=(a,n,t)
|
67 | 78 | 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
|
68 | 79 | 91: n += a
|
| 80 | +92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) |
69 | 81 | 90: t += i * a
|
70 | 82 | 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
|
71 | 83 | 86: for i, a := range hist {
|
|
74 | 86 | 87: if a == 0 { //gdb-opt=(a,n,t)
|
75 | 87 | 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
|
76 | 88 | 91: n += a
|
| 89 | +92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) |
77 | 90 | 90: t += i * a
|
78 | 91 | 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
|
79 | 92 | 86: for i, a := range hist {
|
80 | 93 | 87: if a == 0 { //gdb-opt=(a,n,t)
|
81 | 94 | 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
|
82 | 95 | 91: n += a
|
| 96 | +92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) |
83 | 97 | 90: t += i * a
|
84 | 98 | 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
|
85 | 99 | 86: for i, a := range hist {
|
|
0 commit comments