Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
afc0c77b
Commit
afc0c77b
authored
Jun 09, 2012
by
Stefan Krah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add one extra comparison to the _mpd_shortmul() case to avoid repetitive code.
parent
6e50b699
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
16 deletions
+8
-16
Modules/_decimal/libmpdec/mpdecimal.c
Modules/_decimal/libmpdec/mpdecimal.c
+8
-16
No files found.
Modules/_decimal/libmpdec/mpdecimal.c
View file @
afc0c77b
...
...
@@ -5543,32 +5543,24 @@ _mpd_qmul(mpd_t *result, const mpd_t *a, const mpd_t *b,
if
(
small
->
len
==
1
)
{
if
((
rdata
=
mpd_calloc
(
rsize
,
sizeof
*
rdata
))
==
NULL
)
{
mpd_seterror
(
result
,
MPD_Malloc_error
,
status
);
return
;
rdata
=
mpd_calloc
(
rsize
,
sizeof
*
rdata
);
if
(
rdata
!=
NULL
)
{
_mpd_shortmul
(
rdata
,
big
->
data
,
big
->
len
,
small
->
data
[
0
])
;
}
_mpd_shortmul
(
rdata
,
big
->
data
,
big
->
len
,
small
->
data
[
0
]);
}
else
if
(
rsize
<=
1024
)
{
rdata
=
_mpd_kmul
(
big
->
data
,
small
->
data
,
big
->
len
,
small
->
len
,
&
rsize
);
if
(
rdata
==
NULL
)
{
mpd_seterror
(
result
,
MPD_Malloc_error
,
status
);
return
;
}
}
else
if
(
rsize
<=
3
*
MPD_MAXTRANSFORM_2N
)
{
rdata
=
_mpd_fntmul
(
big
->
data
,
small
->
data
,
big
->
len
,
small
->
len
,
&
rsize
);
if
(
rdata
==
NULL
)
{
mpd_seterror
(
result
,
MPD_Malloc_error
,
status
);
return
;
}
}
else
{
rdata
=
_mpd_kmul_fnt
(
big
->
data
,
small
->
data
,
big
->
len
,
small
->
len
,
&
rsize
);
if
(
rdata
==
NULL
)
{
mpd_seterror
(
result
,
MPD_Malloc_error
,
status
);
/* GCOV_UNLIKELY */
return
;
/* GCOV_UNLIKELY */
}
}
if
(
rdata
==
NULL
)
{
mpd_seterror
(
result
,
MPD_Malloc_error
,
status
);
return
;
}
if
(
mpd_isdynamic_data
(
result
))
{
...
...
Write
Preview
Markdown
is supported
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