summaryrefslogtreecommitdiff
path: root/Objects/listobject.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-11-18 22:15:44 +0100
committerVictor Stinner <victor.stinner@gmail.com>2013-11-18 22:15:44 +0100
commitea29c2eb51334b29ea2ec82c27d2ac56504e9693 (patch)
tree45c30e6ce9bd685733afe81d895ac02688bd319f /Objects/listobject.c
parentcce232fec42ad615223d64e5ed970b338b21189c (diff)
downloadcpython-ea29c2eb51334b29ea2ec82c27d2ac56504e9693.tar.gz
Issue #19513: Simplify list_repr()
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 5e40667239..50538e178a 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -359,14 +359,8 @@ list_repr(PyListObject *v)
_PyUnicodeWriter_Init(&writer);
writer.overallocate = 1;
- if (Py_SIZE(v) > 1) {
- /* "[" + "1" + ", 2" * (len - 1) + "]" */
- writer.min_length = 1 + 1 + (2 + 1) * (Py_SIZE(v) - 1) + 1;
- }
- else {
- /* "[1]" */
- writer.min_length = 3;
- }
+ /* "[" + "1" + ", 2" * (len - 1) + "]" */
+ writer.min_length = 1 + 1 + (2 + 1) * (Py_SIZE(v) - 1) + 1;
if (_PyUnicodeWriter_WriteChar(&writer, '[') < 0)
goto error;