From 313569db5659e68f826bac9771fff6f01867b4f1 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 8 Jan 2022 13:38:56 -0600 Subject: [PATCH] Remove useless allocations --- pgtype/bool.go | 4 ++-- pgtype/box.go | 4 ++-- pgtype/circle.go | 4 ++-- pgtype/int.go | 12 ++++++------ pgtype/int.go.erb | 4 ++-- pgtype/point.go | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pgtype/bool.go b/pgtype/bool.go index 60bec0f3..21cd9889 100644 --- a/pgtype/bool.go +++ b/pgtype/bool.go @@ -108,9 +108,9 @@ func (BoolCodec) PreferredFormat() int16 { func (BoolCodec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interface{}) EncodePlan { switch format { case BinaryFormatCode: - return &encodePlanBoolCodecBinary{} + return encodePlanBoolCodecBinary{} case TextFormatCode: - return &encodePlanBoolCodecText{} + return encodePlanBoolCodecText{} } return nil diff --git a/pgtype/box.go b/pgtype/box.go index 8f96a016..677d4bd2 100644 --- a/pgtype/box.go +++ b/pgtype/box.go @@ -78,9 +78,9 @@ func (BoxCodec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interfa switch format { case BinaryFormatCode: - return &encodePlanBoxCodecBinary{} + return encodePlanBoxCodecBinary{} case TextFormatCode: - return &encodePlanBoxCodecText{} + return encodePlanBoxCodecText{} } return nil diff --git a/pgtype/circle.go b/pgtype/circle.go index f2c591b4..ae8aa352 100644 --- a/pgtype/circle.go +++ b/pgtype/circle.go @@ -79,9 +79,9 @@ func (CircleCodec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value inte switch format { case BinaryFormatCode: - return &encodePlanCircleCodecBinary{} + return encodePlanCircleCodecBinary{} case TextFormatCode: - return &encodePlanCircleCodecText{} + return encodePlanCircleCodecText{} } return nil diff --git a/pgtype/int.go b/pgtype/int.go index 785b481b..5fee64a6 100644 --- a/pgtype/int.go +++ b/pgtype/int.go @@ -122,9 +122,9 @@ func (Int2Codec) PreferredFormat() int16 { func (Int2Codec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interface{}) EncodePlan { switch format { case BinaryFormatCode: - return &encodePlanInt2CodecBinary{} + return encodePlanInt2CodecBinary{} case TextFormatCode: - return &encodePlanInt2CodecText{} + return encodePlanInt2CodecText{} } return nil @@ -629,9 +629,9 @@ func (Int4Codec) PreferredFormat() int16 { func (Int4Codec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interface{}) EncodePlan { switch format { case BinaryFormatCode: - return &encodePlanInt4CodecBinary{} + return encodePlanInt4CodecBinary{} case TextFormatCode: - return &encodePlanInt4CodecText{} + return encodePlanInt4CodecText{} } return nil @@ -1147,9 +1147,9 @@ func (Int8Codec) PreferredFormat() int16 { func (Int8Codec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interface{}) EncodePlan { switch format { case BinaryFormatCode: - return &encodePlanInt8CodecBinary{} + return encodePlanInt8CodecBinary{} case TextFormatCode: - return &encodePlanInt8CodecText{} + return encodePlanInt8CodecText{} } return nil diff --git a/pgtype/int.go.erb b/pgtype/int.go.erb index ba93c8e1..419dddd2 100644 --- a/pgtype/int.go.erb +++ b/pgtype/int.go.erb @@ -123,9 +123,9 @@ func (Int<%= pg_byte_size %>Codec) PreferredFormat() int16 { func (Int<%= pg_byte_size %>Codec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interface{}) EncodePlan { switch format { case BinaryFormatCode: - return &encodePlanInt<%= pg_byte_size %>CodecBinary{} + return encodePlanInt<%= pg_byte_size %>CodecBinary{} case TextFormatCode: - return &encodePlanInt<%= pg_byte_size %>CodecText{} + return encodePlanInt<%= pg_byte_size %>CodecText{} } return nil diff --git a/pgtype/point.go b/pgtype/point.go index 2d3380fd..a9be4fdc 100644 --- a/pgtype/point.go +++ b/pgtype/point.go @@ -134,9 +134,9 @@ func (PointCodec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value inter switch format { case BinaryFormatCode: - return &encodePlanPointCodecBinary{} + return encodePlanPointCodecBinary{} case TextFormatCode: - return &encodePlanPointCodecText{} + return encodePlanPointCodecText{} } return nil