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
94f6fa62
Commit
94f6fa62
authored
Jan 08, 2012
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #13738: Simplify implementation of bytes.lower() and bytes.upper().
parent
69f39a53
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
10 deletions
+4
-10
Misc/NEWS
Misc/NEWS
+2
-0
Objects/bytes_methods.c
Objects/bytes_methods.c
+2
-10
No files found.
Misc/NEWS
View file @
94f6fa62
...
...
@@ -10,6 +10,8 @@ What's New in Python 3.3 Alpha 1?
Core and Builtins
-----------------
- Issue #13738: Simplify implementation of bytes.lower() and bytes.upper().
- Issue #13577: Built-in methods and functions now have a __qualname__.
Patch by sbt.
...
...
Objects/bytes_methods.c
View file @
94f6fa62
...
...
@@ -248,12 +248,8 @@ _Py_bytes_lower(char *result, const char *cptr, Py_ssize_t len)
{
Py_ssize_t
i
;
Py_MEMCPY
(
result
,
cptr
,
len
);
for
(
i
=
0
;
i
<
len
;
i
++
)
{
int
c
=
Py_CHARMASK
(
result
[
i
]);
if
(
Py_ISUPPER
(
c
))
result
[
i
]
=
Py_TOLOWER
(
c
);
result
[
i
]
=
Py_TOLOWER
((
unsigned
char
)
cptr
[
i
]);
}
}
...
...
@@ -268,12 +264,8 @@ _Py_bytes_upper(char *result, const char *cptr, Py_ssize_t len)
{
Py_ssize_t
i
;
Py_MEMCPY
(
result
,
cptr
,
len
);
for
(
i
=
0
;
i
<
len
;
i
++
)
{
int
c
=
Py_CHARMASK
(
result
[
i
]);
if
(
Py_ISLOWER
(
c
))
result
[
i
]
=
Py_TOUPPER
(
c
);
result
[
i
]
=
Py_TOUPPER
((
unsigned
char
)
cptr
[
i
]);
}
}
...
...
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