From 981d7dab13a4b7a0b11bc717339088ffbcd3863d Mon Sep 17 00:00:00 2001 From: hudahai Date: Sat, 4 Feb 2023 15:35:54 +0800 Subject: [PATCH] feat: revert bytes.Buffer to strings.Builder --- core/stringx/replacer.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/stringx/replacer.go b/core/stringx/replacer.go index 5912b141..1a7a5398 100644 --- a/core/stringx/replacer.go +++ b/core/stringx/replacer.go @@ -1,8 +1,6 @@ package stringx -import ( - "bytes" -) +import "strings" type ( // Replacer interface wraps the Replace method. @@ -32,7 +30,7 @@ func NewReplacer(mapping map[string]string) Replacer { // Replace replaces text with given substitutes. func (r *replacer) Replace(text string) string { - var buf bytes.Buffer + var buf strings.Builder target := []rune(text) cur := r.node nextStart := 0