Skip to content

Commit 5580154

Browse files
author
Pesternikov Stepan
committed
Remove extra allocations in types.TupleValue, types.ListValue and types.SetValue
1 parent 1e08906 commit 5580154

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Deprecated WithOnWriterFirstConnected callback, use Writer.WaitInitInfo instead.
55
* Changed topic Codec base type from int to int32 (was experimental code)
66
* Added `WaitInit` and `WaitInitInfo` method to the topic reader and writer
7+
* Remove extra allocations in `types.TupleValue`, `types.ListValue` and `types.SetValue`
78

89
## v3.52.2
910
* Removed support of placeholder "_" for ignoring columns in `database/sql` result sets

table/types/value.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,21 +200,15 @@ func DecimalValueFromBigInt(v *big.Int, precision, scale uint32) Value {
200200
}
201201

202202
func TupleValue(vs ...Value) Value {
203-
return value.TupleValue(func() (vv []value.Value) {
204-
return append(vv, vs...)
205-
}()...)
203+
return value.TupleValue(vs...)
206204
}
207205

208206
func ListValue(vs ...Value) Value {
209-
return value.ListValue(func() (vv []value.Value) {
210-
return append(vv, vs...)
211-
}()...)
207+
return value.ListValue(vs...)
212208
}
213209

214210
func SetValue(vs ...Value) Value {
215-
return value.SetValue(func() (vv []value.Value) {
216-
return append(vv, vs...)
217-
}()...)
211+
return value.SetValue(vs...)
218212
}
219213

220214
type structValueFields struct {

0 commit comments

Comments
 (0)