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
55e5dc83
Commit
55e5dc83
authored
Jun 06, 2012
by
Kristján Valur Jónsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rearrange code to beat an optimizer bug affecting Release x64 on windows
with VS2010sp1
parent
a3394bce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
Objects/unicodeobject.c
Objects/unicodeobject.c
+10
-12
No files found.
Objects/unicodeobject.c
View file @
55e5dc83
...
...
@@ -12038,30 +12038,28 @@ unicode_repr(PyObject *unicode)
(categories Z* and C* except ASCII space)
*/
if
(
!
Py_UNICODE_ISPRINTABLE
(
ch
))
{
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
'\\'
);
/* Map 8-bit characters to '\xhh' */
if
(
ch
<=
0xff
)
{
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
'\\'
);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
'x'
);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[(
ch
>>
4
)
&
0x000F
]);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[
ch
&
0x000F
]);
}
/* Map 21-bit characters to '\U00xxxxxx' */
else
if
(
ch
>=
0x10000
)
{
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
'\\'
);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
'U'
);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[(
ch
>>
28
)
&
0xF
]);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[(
ch
>>
24
)
&
0xF
]);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[(
ch
>>
20
)
&
0xF
]);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[(
ch
>>
16
)
&
0xF
]);
/* Map 16-bit characters to '\uxxxx' */
else
if
(
ch
<=
0xffff
)
{
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
'u'
);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[(
ch
>>
12
)
&
0xF
]);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[(
ch
>>
8
)
&
0xF
]);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[(
ch
>>
4
)
&
0xF
]);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[
ch
&
0xF
]);
}
/* Map
16-bit characters to '\u
xxxx' */
/* Map
21-bit characters to '\U00xx
xxxx' */
else
{
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
'\\'
);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
'u'
);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
'U'
);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[(
ch
>>
28
)
&
0xF
]);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[(
ch
>>
24
)
&
0xF
]);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[(
ch
>>
20
)
&
0xF
]);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[(
ch
>>
16
)
&
0xF
]);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[(
ch
>>
12
)
&
0xF
]);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[(
ch
>>
8
)
&
0xF
]);
PyUnicode_WRITE
(
okind
,
odata
,
o
++
,
Py_hexdigits
[(
ch
>>
4
)
&
0xF
]);
...
...
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