[Python-checkins] python/dist/src/Objects listobject.c,2.201,2.202

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Mon Apr 12 10:01:23 EDT 2004


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27456

Modified Files:
	listobject.c 
Log Message:
Small refactoring saving one function() and eliminating some indirection.
* Applied app1() to listappend().
* Inlined ins() into its one remaining caller.



Index: listobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v
retrieving revision 2.201
retrieving revision 2.202
diff -C2 -d -r2.201 -r2.202
*** listobject.c	12 Apr 2004 13:05:09 -0000	2.201
--- listobject.c	12 Apr 2004 14:01:16 -0000	2.202
***************
*** 647,659 ****
  
  static PyObject *
- ins(PyListObject *self, int where, PyObject *v)
- {
- 	if (ins1(self, where, v) != 0)
- 		return NULL;
- 	Py_INCREF(Py_None);
- 	return Py_None;
- }
- 
- static PyObject *
  listinsert(PyListObject *self, PyObject *args)
  {
--- 647,650 ----
***************
*** 662,666 ****
  	if (!PyArg_ParseTuple(args, "iO:insert", &i, &v))
  		return NULL;
! 	return ins(self, i, v);
  }
  
--- 653,661 ----
  	if (!PyArg_ParseTuple(args, "iO:insert", &i, &v))
  		return NULL;
! 	if (ins1(self, i, v) == 0) {
! 		Py_INCREF(Py_None);
! 		return Py_None;
! 	}
! 	return NULL;
  }
  
***************
*** 668,672 ****
  listappend(PyListObject *self, PyObject *v)
  {
! 	return ins(self, (int) self->ob_size, v);
  }
  
--- 663,671 ----
  listappend(PyListObject *self, PyObject *v)
  {
! 	if (app1(self, v) == 0) {
! 		Py_INCREF(Py_None);
! 		return Py_None;
! 	}
! 	return NULL;
  }
  




More information about the Python-checkins mailing list