deleted some dead code
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
package bngsdk
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"math"
|
||||
@@ -22,8 +21,6 @@ type BeamNGSDK struct {
|
||||
Conn *net.UDPConn
|
||||
Buffer []byte
|
||||
Data Outgauge
|
||||
// Internal data
|
||||
reader bytes.Reader
|
||||
}
|
||||
|
||||
func createUDPConnection(ip string, port int) (*net.UDPConn, *net.UDPAddr, error) {
|
||||
@@ -84,7 +81,6 @@ func (sdk *BeamNGSDK) ReadData() error {
|
||||
}
|
||||
|
||||
// Read the binary data into the struct
|
||||
sdk.reader.Reset(sdk.Buffer[:n])
|
||||
err = sdk.parseData()
|
||||
if err != nil {
|
||||
fmt.Println("Error decoding UDP packet:", err)
|
||||
|
||||
+1
-2
@@ -38,9 +38,8 @@ func BenchmarkReadData(b *testing.B) {
|
||||
}
|
||||
packetBytes := buf.Bytes()
|
||||
|
||||
// 4. Reset the timer to isolate the setup allocations from the loop metrics
|
||||
b.ResetTimer()
|
||||
b.ReportAllocs() // Tracks memory allocations per operation (B/op and allocs/op)
|
||||
b.ReportAllocs()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
// Feed a packet into the network buffer right before reading it
|
||||
|
||||
Reference in New Issue
Block a user