forked from quic-go/quic-go
simplify (and speed up) IsFrameAckEliciting
This commit is contained in:
@@ -4,12 +4,8 @@ import "github.com/lucas-clemente/quic-go/internal/wire"
|
|||||||
|
|
||||||
// IsFrameAckEliciting returns true if the frame is ack-eliciting.
|
// IsFrameAckEliciting returns true if the frame is ack-eliciting.
|
||||||
func IsFrameAckEliciting(f wire.Frame) bool {
|
func IsFrameAckEliciting(f wire.Frame) bool {
|
||||||
switch f.(type) {
|
_, ok := f.(*wire.AckFrame)
|
||||||
case *wire.AckFrame:
|
return !ok
|
||||||
return false
|
|
||||||
default:
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// HasAckElicitingFrames returns true if at least one frame is ack-eliciting.
|
// HasAckElicitingFrames returns true if at least one frame is ack-eliciting.
|
||||||
|
|||||||
Reference in New Issue
Block a user