Skip to content

Commit

Permalink
remove unused sequence number from mdata struct
Browse files Browse the repository at this point in the history
Summary: Sequence number is used as a key of the mData map. We don't need it inside the struct itself and it's not actually used

Reviewed By: abulimov

Differential Revision: D56704209

fbshipit-source-id: e014f6734f37fabcb1fcfa71d699bcdc62d4e024
  • Loading branch information
leoleovich authored and facebook-github-bot committed Apr 29, 2024
1 parent 35f3e1e commit 32516f7
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions ptp/sptp/client/measurements.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ const (

// mData is a single measured raw data of GM to OC communication
type mData struct {
seq uint16
t1 time.Time // departure time of Sync packet from GM
t2 time.Time // arrival time of Sync packet on OC
t3 time.Time // departure time of DelayReq from OC
t4 time.Time // arrival time of DelayReq packet on GM
c2 time.Duration // // correctionFiled of DelayReq
c1 time.Duration // correctionField of Sync
t1 time.Time // departure time of Sync packet from GM
t2 time.Time // arrival time of Sync packet on OC
t3 time.Time // departure time of DelayReq from OC
t4 time.Time // arrival time of DelayReq packet on GM
c2 time.Duration // correctionFiled of DelayReq
c1 time.Duration // correctionField of Sync
}

func (d *mData) Complete() bool {
Expand Down Expand Up @@ -92,7 +91,7 @@ func (m *measurements) addT2andCF1(seq uint16, ts time.Time, correction time.Dur
v.t2 = ts
v.c1 = correction
} else {
m.data[seq] = &mData{seq: seq, t2: ts, c1: correction}
m.data[seq] = &mData{t2: ts, c1: correction}
}
}

Expand All @@ -103,7 +102,7 @@ func (m *measurements) addT1(seq uint16, ts time.Time) {
if found {
v.t1 = ts
} else {
m.data[seq] = &mData{seq: seq, t1: ts}
m.data[seq] = &mData{t1: ts}
}
}
func (m *measurements) addCF2(seq uint16, correction time.Duration) {
Expand All @@ -113,7 +112,7 @@ func (m *measurements) addCF2(seq uint16, correction time.Duration) {
if found {
v.c2 = correction
} else {
m.data[seq] = &mData{seq: seq, c2: correction}
m.data[seq] = &mData{c2: correction}
}
}

Expand All @@ -124,7 +123,7 @@ func (m *measurements) addT3(seq uint16, ts time.Time) {
if found {
v.t3 = ts
} else {
m.data[seq] = &mData{seq: seq, t3: ts}
m.data[seq] = &mData{t3: ts}
}
}

Expand All @@ -136,7 +135,7 @@ func (m *measurements) addT4(seq uint16, ts time.Time) {
if found {
v.t4 = ts
} else {
m.data[seq] = &mData{seq: seq, t4: ts}
m.data[seq] = &mData{t4: ts}
}
}

Expand Down

0 comments on commit 32516f7

Please sign in to comment.