Skip to content

Commit

Permalink
speed up table entry generateIt() (#609)
Browse files Browse the repository at this point in the history
* speed up table entry generateIt

* make it concise
  • Loading branch information
avamingli authored and blgm committed Sep 19, 2019
1 parent 7bb3091 commit 5049dc5
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions extensions/table/table_entry.go
Expand Up @@ -22,18 +22,15 @@ func (t TableEntry) generateIt(itBody reflect.Value) {
return
}

values := []reflect.Value{}
values := make([]reflect.Value, len(t.Parameters))
iBodyType := itBody.Type()
for i, param := range t.Parameters {
var value reflect.Value

if param == nil {
inType := itBody.Type().In(i)
value = reflect.Zero(inType)
inType := iBodyType.In(i)
values[i] = reflect.Zero(inType)
} else {
value = reflect.ValueOf(param)
values[i] = reflect.ValueOf(param)
}

values = append(values, value)
}

body := func() {
Expand Down

0 comments on commit 5049dc5

Please sign in to comment.