Skip to content

Commit bafe87e

Browse files
committed
Remove unused variables and add comments.
1 parent 266a284 commit bafe87e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/runtime/methodbinder.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,6 @@ static bool MatchesArgumentCount(int pynargs, ParameterInfo[] parameters,
690690
var match = false;
691691
int clrnargs = parameters.Length;
692692
paramsArray = clrnargs > 0 ? Attribute.IsDefined(parameters[clrnargs - 1], typeof(ParamArrayAttribute)) : false;
693-
var kwargCount = kwargDict.Count;
694693
kwargsMatched = 0;
695694
defaultsNeeded = 0;
696695
if (pynargs == clrnargs && kwargDict.Count == 0)
@@ -701,7 +700,8 @@ static bool MatchesArgumentCount(int pynargs, ParameterInfo[] parameters,
701700
{
702701
// every parameter past 'positionalArgumentCount' must have either
703702
// a corresponding keyword argument or a default parameter, unless
704-
// the method is an operator or accepts a params array.
703+
// the method is an operator or accepts a params array (which cannot
704+
// have a default value)
705705
match = true;
706706
defaultArgList = new ArrayList();
707707
for (var v = pynargs; v < clrnargs; v++)
@@ -725,6 +725,8 @@ static bool MatchesArgumentCount(int pynargs, ParameterInfo[] parameters,
725725
}
726726
else if (!isOperator && !paramsArray)
727727
{
728+
// this is separate above because an operator method cannot have
729+
// keyword args, default args, or params arrays (exclusive cases)
728730
match = false;
729731
}
730732
}

src/runtime/operatormethod.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ public static bool IsOperatorMethod(MethodBase method)
7878

7979
public static void FixupSlots(IntPtr pyType, Type clrType)
8080
{
81-
// This is not used
82-
IntPtr tp_as_number = Marshal.ReadIntPtr(pyType, TypeOffset.tp_as_number);
83-
8481
const BindingFlags flags = BindingFlags.Public | BindingFlags.Static;
8582
Debug.Assert(_opType != null);
8683
foreach (var method in clrType.GetMethods(flags))

0 commit comments

Comments
 (0)