net: simplify internal dtoi and xtoi funcs

Callers pass strings sliced as necessary instead of giving
an offset.

Fixes #16350

Change-Id: I7ba896f6ff09e0fd0094ca6c5af5d9a81622f15e
Reviewed-on: https://go-review.googlesource.com/27206
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Dan Peterson 2016-08-16 13:33:27 -03:00 committed by Matthew Dempsky
parent 9c13eb3729
commit 00b779aeed
13 changed files with 74 additions and 78 deletions

View file

@ -26,7 +26,7 @@ func readProtocols() {
if len(f) < 2 {
continue
}
if proto, _, ok := dtoi(f[1], 0); ok {
if proto, _, ok := dtoi(f[1]); ok {
if _, ok := protocols[f[0]]; !ok {
protocols[f[0]] = proto
}