Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
d279bcff
Commit
d279bcff
authored
Mar 16, 2017
by
Damien George
Browse files
py/objstr: Fix eager optimisation of str/bytes addition.
The RHS can only be returned if it is the same type as the LHS.
parent
7b7ff60f
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/objstr.c
View file @
d279bcff
...
...
@@ -354,7 +354,7 @@ mp_obj_t mp_obj_str_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) {
switch
(
op
)
{
case
MP_BINARY_OP_ADD
:
case
MP_BINARY_OP_INPLACE_ADD
:
{
if
(
lhs_len
==
0
)
{
if
(
lhs_len
==
0
&&
mp_obj_get_type
(
rhs_in
)
==
lhs_type
)
{
return
rhs_in
;
}
if
(
rhs_len
==
0
)
{
...
...
Write
Preview
Supports
Markdown
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