Skip to content

Commit

Permalink
pgtype/hstore.go: Remove unused quoteHstore{Element,Replacer}
Browse files Browse the repository at this point in the history
These are unused. The code uses quoteArrayElement instead.
  • Loading branch information
evanj authored and jackc committed May 13, 2023
1 parent 2a86501 commit d8b38b2
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions pgtype/hstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,6 @@ func (c HstoreCodec) DecodeValue(m *Map, oid uint32, format int16, src []byte) (
return hstore, nil
}

var quoteHstoreReplacer = strings.NewReplacer(`\`, `\\`, `"`, `\"`)

func quoteHstoreElement(src string) string {
return `"` + quoteArrayReplacer.Replace(src) + `"`
}

func quoteHstoreElementIfNeeded(src string) string {
if src == "" || (len(src) == 4 && strings.ToLower(src) == "null") || strings.ContainsAny(src, ` {},"\=>`) {
return quoteArrayElement(src)
Expand Down

0 comments on commit d8b38b2

Please sign in to comment.