Commit c85ca5e2 authored by Vojtech Vitek's avatar Vojtech Vitek

Merge pull request #6 from c2h5oh/master

One allocation is enough
parents 5d1310aa 6cc34386
......@@ -72,9 +72,9 @@ func (conn *Conn) do(args []interface{}) (interface{}, error) {
defer sess.Close()
fn := reflect.ValueOf(sess.Do)
reflectArgs := []reflect.Value{}
for _, arg := range args {
reflectArgs = append(reflectArgs, reflect.ValueOf(arg))
reflectArgs := make([]reflect.Value, len(args))
for i, arg := range args {
reflectArgs[i] = reflect.ValueOf(arg)
}
ret := fn.Call(reflectArgs)
if len(ret) != 2 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment