Skip to content

Commit

Permalink
Stop matching in filteredPendingLocked FSS scan when partial found
Browse files Browse the repository at this point in the history
Signed-off-by: Neil Twigg <[email protected]>
  • Loading branch information
neilalexander committed Jul 5, 2024
1 parent cc7f492 commit 07a5f35
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/filestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -2499,6 +2499,10 @@ func (mb *msgBlock) filteredPendingLocked(filter string, wc bool, sseq uint64) (

var havePartial bool
mb.fss.Match(stringToBytes(filter), func(bsubj []byte, ss *SimpleState) {
if havePartial {
// If we already found a partial then don't do anything else.
return
}
if ss.firstNeedsUpdate {
mb.recalculateFirstForSubj(bytesToString(bsubj), ss.First, ss)
}
Expand Down

0 comments on commit 07a5f35

Please sign in to comment.