BufPool Placeholders

This commit is contained in:
Patrick O'brien 2016-08-13 23:55:52 +10:00
parent ab9e5c89bd
commit ce65125ade

View file

@ -5,7 +5,6 @@
package strmangle package strmangle
import ( import (
"bytes"
"fmt" "fmt"
"math" "math"
"regexp" "regexp"
@ -250,7 +249,8 @@ func PrefixStringSlice(str string, strs []string) []string {
// For example, ($1, $2, $3), ($4, $5, $6) etc. // For example, ($1, $2, $3), ($4, $5, $6) etc.
// It will start counting placeholders at "start". // It will start counting placeholders at "start".
func Placeholders(count int, start int, group int) string { func Placeholders(count int, start int, group int) string {
var buf bytes.Buffer buf := GetBuffer()
defer PutBuffer(buf)
if start == 0 || group == 0 { if start == 0 || group == 0 {
panic("Invalid start or group numbers supplied.") panic("Invalid start or group numbers supplied.")