comparison mercurial/parsers.c @ 26213:4d6cdea33f37

parsers: use PyTuple_SET_ITEM() to fill new marker tuples Because we know these tuples have no member yet, PyTuple_SetItem() isn't necessary.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 05 Sep 2015 16:41:21 +0900
parents 50582df9d7a7
children 46605888faf3
comparison
equal deleted inserted replaced
26212:0d8df1f510c6 26213:4d6cdea33f37
2562 PyObject *hash = PyString_FromStringAndSize(source, hashwidth); 2562 PyObject *hash = PyString_FromStringAndSize(source, hashwidth);
2563 if (hash == NULL) { 2563 if (hash == NULL) {
2564 Py_DECREF(list); 2564 Py_DECREF(list);
2565 return NULL; 2565 return NULL;
2566 } 2566 }
2567 PyTuple_SetItem(list, i, hash); 2567 PyTuple_SET_ITEM(list, i, hash);
2568 source += hashwidth; 2568 source += hashwidth;
2569 } 2569 }
2570 return list; 2570 return list;
2571 } 2571 }
2572 2572
2645 Py_DECREF(left); 2645 Py_DECREF(left);
2646 Py_DECREF(right); 2646 Py_DECREF(right);
2647 if (!tmp) { 2647 if (!tmp) {
2648 goto bail; 2648 goto bail;
2649 } 2649 }
2650 PyTuple_SetItem(metadata, i, tmp); 2650 PyTuple_SET_ITEM(metadata, i, tmp);
2651 } 2651 }
2652 ret = Py_BuildValue("(OOHO(di)O)", prec, succs, flags, 2652 ret = Py_BuildValue("(OOHO(di)O)", prec, succs, flags,
2653 metadata, mtime, (int)tz * 60, parents); 2653 metadata, mtime, (int)tz * 60, parents);
2654 bail: 2654 bail:
2655 Py_XDECREF(prec); 2655 Py_XDECREF(prec);