| Code with Finding: |
class CodeGenerator {
/**
* This function adds a comma-separated list as is specified by an ARRAYLIT
* node with the associated skipIndexes array. This is a space optimization
* since we avoid creating a whole Node object for each empty array literal
* slot.
* @param firstInList The first in the node list (chained through the next
* property).
* @param skipIndexes If not null, then the array of skipped entries in the
* array.
*/
void addList(Node firstInList, int[] skipIndexes) {
int nextSlot = 0;
int nextSkipSlot = 0;
for (Node n = firstInList; n != null; n = n.getNext()) {
while (skipIndexes != null && nextSkipSlot < skipIndexes.length) {
if (nextSlot == skipIndexes[nextSkipSlot]) {
cc.listSeparator();
nextSlot++;
nextSkipSlot++;
} else {
break;
}
}
if (n != firstInList) {
cc.listSeparator();
}
addExpr(n, 1);
nextSlot++;
}
}
}
|