Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
a785a3db
Commit
a785a3db
authored
6 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py/objarray: Allow to build again when bytearray is disabled.
parent
91041945
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
py/objarray.c
+3
-2
3 additions, 2 deletions
py/objarray.c
with
3 additions
and
2 deletions
py/objarray.c
+
3
−
2
View file @
a785a3db
...
@@ -270,10 +270,10 @@ STATIC mp_obj_t array_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs
...
@@ -270,10 +270,10 @@ STATIC mp_obj_t array_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs
}
}
case
MP_BINARY_OP_CONTAINS
:
{
case
MP_BINARY_OP_CONTAINS
:
{
#if MICROPY_PY_BUILTINS_BYTEARRAY
// Can search string only in bytearray
mp_buffer_info_t
lhs_bufinfo
;
mp_buffer_info_t
lhs_bufinfo
;
mp_buffer_info_t
rhs_bufinfo
;
mp_buffer_info_t
rhs_bufinfo
;
// Can search string only in bytearray
if
(
mp_get_buffer
(
rhs_in
,
&
rhs_bufinfo
,
MP_BUFFER_READ
))
{
if
(
mp_get_buffer
(
rhs_in
,
&
rhs_bufinfo
,
MP_BUFFER_READ
))
{
if
(
!
MP_OBJ_IS_TYPE
(
lhs_in
,
&
mp_type_bytearray
))
{
if
(
!
MP_OBJ_IS_TYPE
(
lhs_in
,
&
mp_type_bytearray
))
{
return
mp_const_false
;
return
mp_const_false
;
...
@@ -282,6 +282,7 @@ STATIC mp_obj_t array_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs
...
@@ -282,6 +282,7 @@ STATIC mp_obj_t array_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs
return
mp_obj_new_bool
(
return
mp_obj_new_bool
(
find_subbytes
(
lhs_bufinfo
.
buf
,
lhs_bufinfo
.
len
,
rhs_bufinfo
.
buf
,
rhs_bufinfo
.
len
,
1
)
!=
NULL
);
find_subbytes
(
lhs_bufinfo
.
buf
,
lhs_bufinfo
.
len
,
rhs_bufinfo
.
buf
,
rhs_bufinfo
.
len
,
1
)
!=
NULL
);
}
}
#endif
// Otherwise, can only look for a scalar numeric value in an array
// Otherwise, can only look for a scalar numeric value in an array
if
(
MP_OBJ_IS_INT
(
rhs_in
)
||
mp_obj_is_float
(
rhs_in
))
{
if
(
MP_OBJ_IS_INT
(
rhs_in
)
||
mp_obj_is_float
(
rhs_in
))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment