Skip to content

Commit a442bdc

Browse files
committed
Simplify tf.range() handling.
1 parent 689829e commit a442bdc

File tree

1 file changed

+3
-5
lines changed
  • com.ibm.wala.cast.python.ml/source/com/ibm/wala/cast/python/ml/client

1 file changed

+3
-5
lines changed

com.ibm.wala.cast.python.ml/source/com/ibm/wala/cast/python/ml/client/Range.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,11 @@ protected Set<List<Dimension<?>>> getShapes(PropagationCallGraphBuilder builder)
8686
}
8787

8888
private int getNumberOfNumericPositionalArgs(PointerAnalysis<InstanceKey> pointerAnalysis) {
89-
int ret = 0;
90-
int explicitArgumentIndex = 2; // Start from the first explicit argument.
89+
int ret = 2; // Start from the first explicit argument.
9190

9291
while (true) {
9392
PointerKey pk =
94-
pointerAnalysis.getHeapModel().getPointerKeyForLocal(node, explicitArgumentIndex);
93+
pointerAnalysis.getHeapModel().getPointerKeyForLocal(node, ret); // Positional arguments.
9594
OrdinalSet<InstanceKey> pointsToSet = pointerAnalysis.getPointsToSet(pk);
9695

9796
if (pointsToSet.isEmpty()) break; // End of positional arguments.
@@ -107,10 +106,9 @@ private int getNumberOfNumericPositionalArgs(PointerAnalysis<InstanceKey> pointe
107106
if (!allNumeric) break; // There's some argument that is not numeric for this argument.
108107

109108
ret++; // Increment the count of numeric positional arguments.
110-
explicitArgumentIndex++; // Move to the next explicit argument.
111109
}
112110

113-
return ret;
111+
return ret - 2; // Subtract 2 to get the number of numeric positional arguments.
114112
}
115113

116114
@Override

0 commit comments

Comments
 (0)