Skip to content

Commit

Permalink
Move tokenizing of subject after early returns (#4880)
Browse files Browse the repository at this point in the history
We do not always need the tokenized subject here.

Signed-off-by: Sven Neumann <sven.neumann@holoplot.com>
  • Loading branch information
derekcollison committed Dec 13, 2023
2 parents 3ba8e17 + a2bcd8d commit 4d9419f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/filestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -2591,8 +2591,6 @@ func (fs *fileStore) NumPending(sseq uint64, filter string, lastPerSubject bool)
}
}

var tsa, fsa [32]string
fts := tokenizeSubjectIntoSlice(fsa[:0], filter)
isAll := filter == _EMPTY_ || filter == fwcs
wc := subjectHasWildcard(filter)

Expand All @@ -2609,6 +2607,9 @@ func (fs *fileStore) NumPending(sseq uint64, filter string, lastPerSubject bool)
return fs.state.LastSeq - sseq + 1, validThrough
}

var tsa, fsa [32]string
fts := tokenizeSubjectIntoSlice(fsa[:0], filter)

isMatch := func(subj string) bool {
if isAll {
return true
Expand Down

0 comments on commit 4d9419f

Please sign in to comment.