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
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
0f59203e
Commit
0f59203e
authored
11 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
Tidy up.
parent
6c2401e9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
py/builtin.c
+1
-1
1 addition, 1 deletion
py/builtin.c
py/obj.h
+1
-1
1 addition, 1 deletion
py/obj.h
py/objlist.c
+2
-2
2 additions, 2 deletions
py/objlist.c
py/objzip.c
+11
-13
11 additions, 13 deletions
py/objzip.c
with
15 additions
and
17 deletions
py/builtin.c
+
1
−
1
View file @
0f59203e
...
...
@@ -339,7 +339,7 @@ static mp_obj_t mp_builtin_sorted(mp_obj_t args, mp_map_t *kwargs) {
}
mp_obj_t
self
=
list_type
.
make_new
((
mp_obj_t
)
&
list_type
,
1
,
args_items
);
mp_obj_t
new_args
=
rt_build_tuple
(
1
,
&
self
);
list_sort
(
new_args
,
kwargs
);
mp_obj_
list_sort
(
new_args
,
kwargs
);
return
self
;
}
...
...
This diff is collapsed.
Click to expand it.
py/obj.h
+
1
−
1
View file @
0f59203e
...
...
@@ -292,7 +292,7 @@ extern const mp_obj_type_t list_type;
mp_obj_t
mp_obj_list_append
(
mp_obj_t
self_in
,
mp_obj_t
arg
);
void
mp_obj_list_get
(
mp_obj_t
self_in
,
uint
*
len
,
mp_obj_t
**
items
);
void
mp_obj_list_store
(
mp_obj_t
self_in
,
mp_obj_t
index
,
mp_obj_t
value
);
mp_obj_t
list_sort
(
mp_obj_t
args
,
struct
_mp_map_t
*
kwargs
);
mp_obj_t
mp_obj_
list_sort
(
mp_obj_t
args
,
struct
_mp_map_t
*
kwargs
);
// dict
extern
const
mp_obj_type_t
dict_type
;
...
...
This diff is collapsed.
Click to expand it.
py/objlist.c
+
2
−
2
View file @
0f59203e
...
...
@@ -248,7 +248,7 @@ static void mp_quicksort(mp_obj_t *head, mp_obj_t *tail, mp_obj_t key_fn, bool r
}
}
mp_obj_t
list_sort
(
mp_obj_t
args
,
mp_map_t
*
kwargs
)
{
mp_obj_t
mp_obj_
list_sort
(
mp_obj_t
args
,
mp_map_t
*
kwargs
)
{
mp_obj_t
*
args_items
=
NULL
;
uint
args_len
=
0
;
...
...
@@ -381,7 +381,7 @@ static MP_DEFINE_CONST_FUN_OBJ_3(list_insert_obj, list_insert);
static
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN
(
list_pop_obj
,
1
,
2
,
list_pop
);
static
MP_DEFINE_CONST_FUN_OBJ_2
(
list_remove_obj
,
list_remove
);
static
MP_DEFINE_CONST_FUN_OBJ_1
(
list_reverse_obj
,
list_reverse
);
static
MP_DEFINE_CONST_FUN_OBJ_KW
(
list_sort_obj
,
0
,
list_sort
);
static
MP_DEFINE_CONST_FUN_OBJ_KW
(
list_sort_obj
,
0
,
mp_obj_
list_sort
);
static
const
mp_method_t
list_type_methods
[]
=
{
{
"append"
,
&
list_append_obj
},
...
...
This diff is collapsed.
Click to expand it.
py/objzip.c
+
11
−
13
View file @
0f59203e
...
...
@@ -12,12 +12,6 @@ typedef struct _mp_obj_zip_t {
mp_obj_t
iters
[];
}
mp_obj_zip_t
;
static
mp_obj_t
zip_getiter
(
mp_obj_t
self_in
)
{
return
self_in
;
}
static
mp_obj_t
zip_iternext
(
mp_obj_t
self_in
);
static
mp_obj_t
zip_make_new
(
mp_obj_t
type_in
,
int
n_args
,
const
mp_obj_t
*
args
)
{
/* NOTE: args are backwards */
mp_obj_zip_t
*
o
=
m_new_obj_var
(
mp_obj_zip_t
,
mp_obj_t
,
n_args
);
...
...
@@ -29,13 +23,9 @@ static mp_obj_t zip_make_new(mp_obj_t type_in, int n_args, const mp_obj_t *args)
return
o
;
}
const
mp_obj_type_t
zip_type
=
{
{
&
mp_const_type
},
"zip"
,
.
make_new
=
zip_make_new
,
.
iternext
=
zip_iternext
,
.
getiter
=
zip_getiter
,
};
static
mp_obj_t
zip_getiter
(
mp_obj_t
self_in
)
{
return
self_in
;
}
static
mp_obj_t
zip_iternext
(
mp_obj_t
self_in
)
{
assert
(
MP_OBJ_IS_TYPE
(
self_in
,
&
zip_type
));
...
...
@@ -57,3 +47,11 @@ static mp_obj_t zip_iternext(mp_obj_t self_in) {
}
return
o
;
}
const
mp_obj_type_t
zip_type
=
{
{
&
mp_const_type
},
"zip"
,
.
make_new
=
zip_make_new
,
.
getiter
=
zip_getiter
,
.
iternext
=
zip_iternext
,
};
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