From 179bc6ecdf0da3d3b506832d26ebdaff91a22b26 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Wed, 13 Jul 2022 22:20:14 +0800 Subject: [PATCH] chore: clean up code --- context/conn.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/context/conn.go b/context/conn.go index 71ec232e..00a125f3 100644 --- a/context/conn.go +++ b/context/conn.go @@ -1,9 +1,9 @@ package context import ( + CN "github.com/Dreamacro/clash/common/net" "net" - CN "github.com/Dreamacro/clash/common/net" C "github.com/Dreamacro/clash/constant" "github.com/gofrs/uuid" ) @@ -17,14 +17,10 @@ type ConnContext struct { func NewConnContext(conn net.Conn, metadata *C.Metadata) *ConnContext { id, _ := uuid.NewV4() - if _, ok := conn.(*CN.BufferedConn); !ok { - conn = CN.NewBufferedConn(conn) - } - return &ConnContext{ id: id, metadata: metadata, - conn: conn, + conn: CN.NewBufferedConn(conn), } }