diff Objects/stringobject.c @ 56050:0e44dcc0b20d legacy-trunk

use macros
author Benjamin Peterson <benjamin@python.org>
date Thu, 17 Sep 2009 21:33:46 +0000
parents 606e97caeb77
children f64c0eb8cc62
line wrap: on
line diff
--- a/Objects/stringobject.c	Thu Sep 17 17:14:04 2009 +0000
+++ b/Objects/stringobject.c	Thu Sep 17 21:33:46 2009 +0000
@@ -3948,7 +3948,7 @@
 string_sizeof(PyStringObject *v)
 {
 	Py_ssize_t res;
-	res = PyStringObject_SIZE + v->ob_size * v->ob_type->tp_itemsize;
+	res = PyStringObject_SIZE + PyString_GET_SIZE(v) * Py_TYPE(v)->tp_itemsize;
 	return PyInt_FromSsize_t(res);
 }