2
0

Remove useless allocations

This commit is contained in:
Jack Christensen
2022-01-08 13:38:56 -06:00
parent 4aff33603d
commit 313569db56
6 changed files with 16 additions and 16 deletions
+2 -2
View File
@@ -108,9 +108,9 @@ func (BoolCodec) PreferredFormat() int16 {
func (BoolCodec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interface{}) EncodePlan { func (BoolCodec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interface{}) EncodePlan {
switch format { switch format {
case BinaryFormatCode: case BinaryFormatCode:
return &encodePlanBoolCodecBinary{} return encodePlanBoolCodecBinary{}
case TextFormatCode: case TextFormatCode:
return &encodePlanBoolCodecText{} return encodePlanBoolCodecText{}
} }
return nil return nil
+2 -2
View File
@@ -78,9 +78,9 @@ func (BoxCodec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interfa
switch format { switch format {
case BinaryFormatCode: case BinaryFormatCode:
return &encodePlanBoxCodecBinary{} return encodePlanBoxCodecBinary{}
case TextFormatCode: case TextFormatCode:
return &encodePlanBoxCodecText{} return encodePlanBoxCodecText{}
} }
return nil return nil
+2 -2
View File
@@ -79,9 +79,9 @@ func (CircleCodec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value inte
switch format { switch format {
case BinaryFormatCode: case BinaryFormatCode:
return &encodePlanCircleCodecBinary{} return encodePlanCircleCodecBinary{}
case TextFormatCode: case TextFormatCode:
return &encodePlanCircleCodecText{} return encodePlanCircleCodecText{}
} }
return nil return nil
+6 -6
View File
@@ -122,9 +122,9 @@ func (Int2Codec) PreferredFormat() int16 {
func (Int2Codec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interface{}) EncodePlan { func (Int2Codec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interface{}) EncodePlan {
switch format { switch format {
case BinaryFormatCode: case BinaryFormatCode:
return &encodePlanInt2CodecBinary{} return encodePlanInt2CodecBinary{}
case TextFormatCode: case TextFormatCode:
return &encodePlanInt2CodecText{} return encodePlanInt2CodecText{}
} }
return nil return nil
@@ -629,9 +629,9 @@ func (Int4Codec) PreferredFormat() int16 {
func (Int4Codec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interface{}) EncodePlan { func (Int4Codec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interface{}) EncodePlan {
switch format { switch format {
case BinaryFormatCode: case BinaryFormatCode:
return &encodePlanInt4CodecBinary{} return encodePlanInt4CodecBinary{}
case TextFormatCode: case TextFormatCode:
return &encodePlanInt4CodecText{} return encodePlanInt4CodecText{}
} }
return nil return nil
@@ -1147,9 +1147,9 @@ func (Int8Codec) PreferredFormat() int16 {
func (Int8Codec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interface{}) EncodePlan { func (Int8Codec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interface{}) EncodePlan {
switch format { switch format {
case BinaryFormatCode: case BinaryFormatCode:
return &encodePlanInt8CodecBinary{} return encodePlanInt8CodecBinary{}
case TextFormatCode: case TextFormatCode:
return &encodePlanInt8CodecText{} return encodePlanInt8CodecText{}
} }
return nil return nil
+2 -2
View File
@@ -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 { func (Int<%= pg_byte_size %>Codec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interface{}) EncodePlan {
switch format { switch format {
case BinaryFormatCode: case BinaryFormatCode:
return &encodePlanInt<%= pg_byte_size %>CodecBinary{} return encodePlanInt<%= pg_byte_size %>CodecBinary{}
case TextFormatCode: case TextFormatCode:
return &encodePlanInt<%= pg_byte_size %>CodecText{} return encodePlanInt<%= pg_byte_size %>CodecText{}
} }
return nil return nil
+2 -2
View File
@@ -134,9 +134,9 @@ func (PointCodec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value inter
switch format { switch format {
case BinaryFormatCode: case BinaryFormatCode:
return &encodePlanPointCodecBinary{} return encodePlanPointCodecBinary{}
case TextFormatCode: case TextFormatCode:
return &encodePlanPointCodecText{} return encodePlanPointCodecText{}
} }
return nil return nil