Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
50b5656a
Commit
50b5656a
authored
Jul 14, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deploy unicode.encode() optimisation also for 'bytes' provided encodings
parent
cedf8a44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+8
-0
No files found.
Cython/Compiler/Optimize.py
View file @
50b5656a
...
@@ -2202,6 +2202,10 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
...
@@ -2202,6 +2202,10 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
encoding
=
encoding_node
.
value
encoding
=
encoding_node
.
value
encoding_node
=
ExprNodes
.
BytesNode
(
encoding_node
.
pos
,
value
=
encoding
,
encoding_node
=
ExprNodes
.
BytesNode
(
encoding_node
.
pos
,
value
=
encoding
,
type
=
PyrexTypes
.
c_char_ptr_type
)
type
=
PyrexTypes
.
c_char_ptr_type
)
elif
encoding_node
.
type
is
Builtin
.
bytes_type
:
encoding
=
None
encoding_node
=
encoding_node
.
coerce_to
(
PyrexTypes
.
c_char_ptr_type
,
self
.
current_env
())
elif
encoding_node
.
type
.
is_string
:
elif
encoding_node
.
type
.
is_string
:
encoding
=
None
encoding
=
None
else
:
else
:
...
@@ -2224,6 +2228,10 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
...
@@ -2224,6 +2228,10 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
error_handling_node
=
ExprNodes
.
BytesNode
(
error_handling_node
=
ExprNodes
.
BytesNode
(
error_handling_node
.
pos
,
value
=
error_handling
,
error_handling_node
.
pos
,
value
=
error_handling
,
type
=
PyrexTypes
.
c_char_ptr_type
)
type
=
PyrexTypes
.
c_char_ptr_type
)
elif
error_handling_node
.
type
is
Builtin
.
bytes_type
:
error_handling
=
None
error_handling_node
=
error_handling_node
.
coerce_to
(
PyrexTypes
.
c_char_ptr_type
,
self
.
current_env
())
elif
error_handling_node
.
type
.
is_string
:
elif
error_handling_node
.
type
.
is_string
:
error_handling
=
None
error_handling
=
None
else
:
else
:
...
...
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