Skip to content

Commit 111011d

Browse files
Apply suggestions from code review
Co-authored-by: Simon Frei <[email protected]>
1 parent 108fe14 commit 111011d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

conn.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (r *filteredConn) ReadBatch(ms []ipv4.Message, flags int) (int, error) {
107107
defer timer.Stop()
108108
}
109109

110-
var msgs []messageWithError
110+
msgs := make([]messageWithError, 0, len(ms))
111111

112112
defer func() {
113113
for _, msg := range msgs {
@@ -157,7 +157,7 @@ loop:
157157
}
158158

159159
ms[i].N = n
160-
ms[i].N = nn
160+
ms[i].NN = nn
161161
ms[i].Flags = msg.Flags
162162
ms[i].Addr = msg.Addr
163163
}

0 commit comments

Comments
 (0)