Skip to content

Commit

Permalink
read data only when matchers need some to determine match status
Browse files Browse the repository at this point in the history
  • Loading branch information
WeidiDeng committed Aug 7, 2024
1 parent b36676f commit 396eeca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layer4/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ func (routes RouteList) Compile(logger *zap.Logger, matchingTimeout time.Duratio
return err
}
for {
// only read more because there is no buffered data or matchers require more.
// only read more because matchers require more.
// can happen if this routes list is embedded in another
if len(cx.buf) == 0 || matcherNeedMore {
if matcherNeedMore {
err = cx.prefetch()
if err != nil {
logFunc := logger.Error
Expand Down

0 comments on commit 396eeca

Please sign in to comment.