From 59b31f88458c7c4474f8f2d45ec45b8088dbf995 Mon Sep 17 00:00:00 2001 From: kaiburjack Date: Tue, 16 Aug 2022 21:53:05 +0200 Subject: [PATCH] Change NamespaceModifier.NamespaceOfToken() to have pointer-receiver Because by-value copying of the NamespaceModifier struct is rather very expensive. --- namespaceModifier.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/namespaceModifier.go b/namespaceModifier.go index 9320f97..cf4b3a3 100644 --- a/namespaceModifier.go +++ b/namespaceModifier.go @@ -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 }