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
8de270b4
Commit
8de270b4
authored
Sep 30, 2016
by
Damien George
Browse files
py/objbool: Make a slight simplification of bool constructor.
Reduces code size for some archs.
parent
eca1408f
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/objbool.c
View file @
8de270b4
...
...
@@ -56,12 +56,10 @@ STATIC mp_obj_t bool_make_new(const mp_obj_type_t *type_in, size_t n_args, size_
(
void
)
type_in
;
mp_arg_check_num
(
n_args
,
n_kw
,
0
,
1
,
false
);
switch
(
n_args
)
{
case
0
:
return
mp_const_false
;
case
1
:
default:
// must be 0 or 1
if
(
mp_obj_is_true
(
args
[
0
]))
{
return
mp_const_true
;
}
else
{
return
mp_const_false
;
}
if
(
n_args
==
0
)
{
return
mp_const_false
;
}
else
{
return
mp_obj_new_bool
(
mp_obj_is_true
(
args
[
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