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
5c398e83
Commit
5c398e83
authored
Nov 13, 2011
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore performance of special casings for utf-16 and utf-32 in TextIOWrapper
parent
c28e2e53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
18 deletions
+12
-18
Modules/_io/textio.c
Modules/_io/textio.c
+12
-18
No files found.
Modules/_io/textio.c
View file @
5c398e83
...
...
@@ -725,17 +725,15 @@ ascii_encode(textio *self, PyObject *text)
static
PyObject
*
utf16be_encode
(
textio
*
self
,
PyObject
*
text
)
{
return
PyUnicode_EncodeUTF16
(
PyUnicode_AS_UNICODE
(
text
),
PyUnicode_GET_SIZE
(
text
),
PyBytes_AS_STRING
(
self
->
errors
),
1
);
return
_PyUnicode_EncodeUTF16
(
text
,
PyBytes_AS_STRING
(
self
->
errors
),
1
);
}
static
PyObject
*
utf16le_encode
(
textio
*
self
,
PyObject
*
text
)
{
return
PyUnicode_EncodeUTF16
(
PyUnicode_AS_UNICODE
(
text
),
PyUnicode_GET_SIZE
(
text
),
PyBytes_AS_STRING
(
self
->
errors
),
-
1
);
return
_PyUnicode_EncodeUTF16
(
text
,
PyBytes_AS_STRING
(
self
->
errors
),
-
1
);
}
static
PyObject
*
...
...
@@ -749,25 +747,22 @@ utf16_encode(textio *self, PyObject *text)
return
utf16le_encode
(
self
,
text
);
#endif
}
return
PyUnicode_EncodeUTF16
(
PyUnicode_AS_UNICODE
(
text
),
PyUnicode_GET_SIZE
(
text
),
PyBytes_AS_STRING
(
self
->
errors
),
0
);
return
_PyUnicode_EncodeUTF16
(
text
,
PyBytes_AS_STRING
(
self
->
errors
),
0
);
}
static
PyObject
*
utf32be_encode
(
textio
*
self
,
PyObject
*
text
)
{
return
PyUnicode_EncodeUTF32
(
PyUnicode_AS_UNICODE
(
text
),
PyUnicode_GET_SIZE
(
text
),
PyBytes_AS_STRING
(
self
->
errors
),
1
);
return
_PyUnicode_EncodeUTF32
(
text
,
PyBytes_AS_STRING
(
self
->
errors
),
1
);
}
static
PyObject
*
utf32le_encode
(
textio
*
self
,
PyObject
*
text
)
{
return
PyUnicode_EncodeUTF32
(
PyUnicode_AS_UNICODE
(
text
),
PyUnicode_GET_SIZE
(
text
),
PyBytes_AS_STRING
(
self
->
errors
),
-
1
);
return
_PyUnicode_EncodeUTF32
(
text
,
PyBytes_AS_STRING
(
self
->
errors
),
-
1
);
}
static
PyObject
*
...
...
@@ -781,9 +776,8 @@ utf32_encode(textio *self, PyObject *text)
return
utf32le_encode
(
self
,
text
);
#endif
}
return
PyUnicode_EncodeUTF32
(
PyUnicode_AS_UNICODE
(
text
),
PyUnicode_GET_SIZE
(
text
),
PyBytes_AS_STRING
(
self
->
errors
),
0
);
return
_PyUnicode_EncodeUTF32
(
text
,
PyBytes_AS_STRING
(
self
->
errors
),
0
);
}
static
PyObject
*
...
...
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