Skip to content

Commit

Permalink
Fix the issue by including the stack-allocated verbatim value inside …
Browse files Browse the repository at this point in the history
…the loop
  • Loading branch information
lestrrat committed Dec 30, 2019
1 parent dc840de commit 7464b8b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions strftime.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ func (ae *appenderExecutor) handle(a Appender) {
}

func compile(handler compileHandler, p string, ds SpecificationSet) error {
// This is a really tight loop, so we don't even calls to
// Verbatim() to cuase extra stuff
var verbatim verbatimw
for l := len(p); l > 0; l = len(p) {
// This is a really tight loop, so we don't even calls to
// Verbatim() to cuase extra stuff
var verbatim verbatimw

i := strings.IndexByte(p, '%')
if i < 0 {
verbatim.s = p
Expand Down

0 comments on commit 7464b8b

Please sign in to comment.