* chore-1

* chore2
This commit is contained in:
tyltr
2022-08-29 13:51:37 +08:00
committed by GitHub
parent 79ccfff72b
commit 404c8a8968
3 changed files with 7 additions and 13 deletions
+1 -3
View File
@@ -252,9 +252,7 @@ var (
)
func readHexInt(r *bufio.Reader) (int, error) {
n := 0
i := 0
var k int
var k, i, n int
for {
c, err := r.ReadByte()
if err != nil {
+3 -1
View File
@@ -48,8 +48,10 @@ type perIPConn struct {
func acquirePerIPConn(conn net.Conn, ip uint32, counter *perIPConnCounter) *perIPConn {
v := counter.pool.Get()
if v == nil {
v = &perIPConn{
return &perIPConn{
perIPConnCounter: counter,
Conn: conn,
ip: ip,
}
}
c := v.(*perIPConn)
+3 -9
View File
@@ -538,15 +538,9 @@ func shouldEscape(c byte, mode encoding) bool {
}
func ishex(c byte) bool {
switch {
case '0' <= c && c <= '9':
return true
case 'a' <= c && c <= 'f':
return true
case 'A' <= c && c <= 'F':
return true
}
return false
return ('0' <= c && c <= '9') ||
('a' <= c && c <= 'f') ||
('A' <= c && c <= 'F')
}
func unhex(c byte) byte {