diff options
author | Anthony Wang | 2022-03-28 11:39:43 -0500 |
---|---|---|
committer | Anthony Wang | 2022-03-28 11:39:43 -0500 |
commit | bd0ff43d83053edbd0809f8bd9ca3cc2abc687d9 (patch) | |
tree | bf730995a2516ea893d7168ef80e97096099ec8c | |
parent | a9c4011549fd38d372920d58f26a9cb2248aada8 (diff) |
Remove extra ints in function declarations
-rw-r--r-- | sd.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -16,7 +16,7 @@ var file = flag.String("f", "cards", "cards file") var sum = 0 var seg = []int{} -func build(a *sql.Rows, l int, r int, n int) { +func build(a *sql.Rows, l, r, n int) { if l == r { a.Next() a.Scan(&seg[n]) @@ -29,7 +29,7 @@ func build(a *sql.Rows, l int, r int, n int) { seg[n] = seg[n<<1] + seg[n<<1|1] } -func update(x int, v int, l int, r int, n int) { +func update(x, v, l, r, n int) { if l == r { seg[n] = v return @@ -43,7 +43,7 @@ func update(x int, v int, l int, r int, n int) { seg[n] = seg[n<<1] + seg[n<<1|1] } -func query(v int, l int, r int, n int) (int, int) { +func query(v, l, r, n int) (int, int) { if l == r { return seg[n], l } @@ -92,7 +92,7 @@ func main() { w, i := query(x, 0, N-1, 1) fmt.Println(w) fmt.Println(i) - + // Get card contents from database var key, val string db.QueryRow("SELECT key, val FROM cards WHERE idx=?", i).Scan(&key, &val) |