Merge pull request #2077 from lucas-clemente/speed-up-is-ack-eliciting

simplify (and speed up) IsFrameAckEliciting
This commit is contained in:
Marten Seemann
2019-08-23 23:00:28 +07:00
committed by GitHub

View File

@@ -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.