Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c6057841
Commit
c6057841
authored
Jun 16, 2001
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dict_repr: Reuse one of the int vars (minor code simplification).
parent
52e155e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Objects/dictobject.c
Objects/dictobject.c
+3
-3
No files found.
Objects/dictobject.c
View file @
c6057841
...
@@ -809,7 +809,7 @@ dict_print(register dictobject *mp, register FILE *fp, register int flags)
...
@@ -809,7 +809,7 @@ dict_print(register dictobject *mp, register FILE *fp, register int flags)
static
PyObject
*
static
PyObject
*
dict_repr
(
dictobject
*
mp
)
dict_repr
(
dictobject
*
mp
)
{
{
int
i
,
pos
;
int
i
;
PyObject
*
s
,
*
temp
,
*
colon
=
NULL
;
PyObject
*
s
,
*
temp
,
*
colon
=
NULL
;
PyObject
*
pieces
=
NULL
,
*
result
=
NULL
;
PyObject
*
pieces
=
NULL
,
*
result
=
NULL
;
PyObject
*
key
,
*
value
;
PyObject
*
key
,
*
value
;
...
@@ -834,8 +834,8 @@ dict_repr(dictobject *mp)
...
@@ -834,8 +834,8 @@ dict_repr(dictobject *mp)
/* Do repr() on each key+value pair, and insert ": " between them.
/* Do repr() on each key+value pair, and insert ": " between them.
Note that repr may mutate the dict. */
Note that repr may mutate the dict. */
pos
=
0
;
i
=
0
;
while
(
PyDict_Next
((
PyObject
*
)
mp
,
&
pos
,
&
key
,
&
value
))
{
while
(
PyDict_Next
((
PyObject
*
)
mp
,
&
i
,
&
key
,
&
value
))
{
int
status
;
int
status
;
/* Prevent repr from deleting value during key format. */
/* Prevent repr from deleting value during key format. */
Py_INCREF
(
value
);
Py_INCREF
(
value
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment