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