File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -378,8 +378,9 @@ func (v Value) call(op string, in []Value) []Value {
378
378
379
379
isSlice := op == "CallSlice"
380
380
n := t .NumIn ()
381
+ isVariadic := t .IsVariadic ()
381
382
if isSlice {
382
- if ! t . IsVariadic () {
383
+ if ! isVariadic {
383
384
panic ("reflect: CallSlice of non-variadic function" )
384
385
}
385
386
if len (in ) < n {
@@ -389,13 +390,13 @@ func (v Value) call(op string, in []Value) []Value {
389
390
panic ("reflect: CallSlice with too many input arguments" )
390
391
}
391
392
} else {
392
- if t . IsVariadic () {
393
+ if isVariadic {
393
394
n --
394
395
}
395
396
if len (in ) < n {
396
397
panic ("reflect: Call with too few input arguments" )
397
398
}
398
- if ! t . IsVariadic () && len (in ) > n {
399
+ if ! isVariadic && len (in ) > n {
399
400
panic ("reflect: Call with too many input arguments" )
400
401
}
401
402
}
@@ -409,7 +410,7 @@ func (v Value) call(op string, in []Value) []Value {
409
410
panic ("reflect: " + op + " using " + xt .String () + " as type " + targ .String ())
410
411
}
411
412
}
412
- if ! isSlice && t . IsVariadic () {
413
+ if ! isSlice && isVariadic {
413
414
// prepare slice for remaining values
414
415
m := len (in ) - n
415
416
slice := MakeSlice (t .In (n ), m , m )
You can’t perform that action at this time.
0 commit comments