Skip to content

Commit

Permalink
Change NamespaceModifier.NamespaceOfToken() to have pointer-receiver
Browse files Browse the repository at this point in the history
Because by-value copying of the NamespaceModifier struct is rather very expensive.
  • Loading branch information
kaiburjack committed Aug 16, 2022
1 parent 4affcda commit 59b31f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion namespaceModifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (thiz *NamespaceModifier) addPrefixRewrite(original, prefix []byte) {
// of the pointed-to Token. The caller must make sure that the Token's fields/values
// will remain unmodified for the lexical scope of the XML element represented
// by that token, as per the documentation of EncoderMiddleware.EncodeToken.
func (thiz NamespaceModifier) NamespaceOfToken(t *Token) []byte {
func (thiz *NamespaceModifier) NamespaceOfToken(t *Token) []byte {
if t.Kind == TokenTypeInvalid {
return nil
}
Expand Down

0 comments on commit 59b31f8

Please sign in to comment.