##// END OF EJS Templates
parsers: optimize filtered headrevs logic...
Durham Goode -
r28386:1c658391 default
parent child Browse files
Show More
@@ -1446,20 +1446,26 b' static PyObject *index_headrevs(indexObj'
1446 goto bail;
1446 goto bail;
1447 }
1447 }
1448
1448
1449 for (i = 0; i < len; i++) {
1449 for (i = len - 1; i >= 0; i--) {
1450 int isfiltered;
1450 int isfiltered;
1451 int parents[2];
1451 int parents[2];
1452
1452
1453 isfiltered = check_filter(filter, i);
1453 /* If nothead[i] == 1, it means we've seen an unfiltered child of this
1454 if (isfiltered == -1) {
1454 * node already, and therefore this node is not filtered. So we can skip
1455 PyErr_SetString(PyExc_TypeError,
1455 * the expensive check_filter step.
1456 "unable to check filter");
1456 */
1457 goto bail;
1457 if (nothead[i] != 1) {
1458 }
1458 isfiltered = check_filter(filter, i);
1459
1459 if (isfiltered == -1) {
1460 if (isfiltered) {
1460 PyErr_SetString(PyExc_TypeError,
1461 nothead[i] = 1;
1461 "unable to check filter");
1462 continue;
1462 goto bail;
1463 }
1464
1465 if (isfiltered) {
1466 nothead[i] = 1;
1467 continue;
1468 }
1463 }
1469 }
1464
1470
1465 if (index_get_parents(self, i, parents, (int)len - 1) < 0)
1471 if (index_get_parents(self, i, parents, (int)len - 1) < 0)
General Comments 0
You need to be logged in to leave comments. Login now