Skip to content

Commit

Permalink
Change mod() function
Browse files Browse the repository at this point in the history
  • Loading branch information
danroc committed Mar 17, 2019
1 parent 4218006 commit f71b1a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion htp.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ func max(a, b int64) int64 {
}

func mod(x, m int64) int64 {
return (m + x%m) % m
y := x % m
if y >= 0 {
return y
}
return m + y
}

func noRedirect(req *http.Request, via []*http.Request) error {
Expand Down

0 comments on commit f71b1a4

Please # to comment.