Skip to content

Commit 1f78665

Browse files
committed
Simplify tick handler
1 parent 7be804a commit 1f78665

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

hidrpc.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ func handleHidRPCKeypressKeepAlive(session *Session) error {
128128
return nil
129129
}
130130

131-
validTick := true
132131
timerExtension := baseExtension
133132

134133
if !session.lastKeepAliveArrivalTime.IsZero() {
@@ -147,14 +146,11 @@ func handleHidRPCKeypressKeepAlive(session *Session) error {
147146
// This is likely a retransmit stall or ordering delay.
148147
// We reject the tick entirely and DO NOT extend,
149148
// so the auto-release still fires on time.
150-
validTick = false
149+
return nil
151150
}
152151
}
153152
}
154153

155-
if !validTick {
156-
return nil
157-
}
158154
// Only valid ticks update our state and extend the timer.
159155
session.lastKeepAliveArrivalTime = now
160156
session.lastTimerResetTime = now

0 commit comments

Comments
 (0)