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
4d1fb610
Commit
4d1fb610
authored
7 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py/mpz: Make mpz_is_zero() an inline function.
It's more efficient as an inline function, and saves code size.
parent
aa7be82a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
py/mpz.c
+0
-4
0 additions, 4 deletions
py/mpz.c
py/mpz.h
+1
-1
1 addition, 1 deletion
py/mpz.h
with
1 addition
and
5 deletions
py/mpz.c
+
0
−
4
View file @
4d1fb610
...
...
@@ -939,10 +939,6 @@ void mpz_set_from_bytes(mpz_t *z, bool big_endian, size_t len, const byte *buf)
z
->
len
=
mpn_remove_trailing_zeros
(
z
->
dig
,
z
->
dig
+
z
->
len
);
}
bool
mpz_is_zero
(
const
mpz_t
*
z
)
{
return
z
->
len
==
0
;
}
#if 0
these functions are unused
...
...
This diff is collapsed.
Click to expand it.
py/mpz.h
+
1
−
1
View file @
4d1fb610
...
...
@@ -111,7 +111,7 @@ void mpz_set_from_float(mpz_t *z, mp_float_t src);
size_t
mpz_set_from_str
(
mpz_t
*
z
,
const
char
*
str
,
size_t
len
,
bool
neg
,
unsigned
int
base
);
void
mpz_set_from_bytes
(
mpz_t
*
z
,
bool
big_endian
,
size_t
len
,
const
byte
*
buf
);
bool
mpz_is_zero
(
const
mpz_t
*
z
)
;
static
inline
bool
mpz_is_zero
(
const
mpz_t
*
z
)
{
return
z
->
len
==
0
;
}
int
mpz_cmp
(
const
mpz_t
*
lhs
,
const
mpz_t
*
rhs
);
void
mpz_abs_inpl
(
mpz_t
*
dest
,
const
mpz_t
*
z
);
...
...
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