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
357bad71
Commit
357bad71
authored
Feb 24, 2017
by
Louie Lu
Committed by
Raymond Hettinger
Feb 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-29634: Reduce deque repeat execution when maxlen exist and size is not 1 (#255) (#255)
parent
abb3b8ad
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
Modules/_collectionsmodule.c
Modules/_collectionsmodule.c
+4
-0
No files found.
Modules/_collectionsmodule.c
View file @
357bad71
...
...
@@ -731,6 +731,10 @@ deque_inplace_repeat(dequeobject *deque, Py_ssize_t n)
if
(
seq
==
NULL
)
return
seq
;
/* Reduce the number of repetitions when maxlen would be exceeded */
if
(
deque
->
maxlen
>=
0
&&
n
*
size
>
deque
->
maxlen
)
n
=
(
deque
->
maxlen
+
size
-
1
)
/
size
;
for
(
i
=
0
;
i
<
n
-
1
;
i
++
)
{
rv
=
deque_extend
(
deque
,
seq
);
if
(
rv
==
NULL
)
{
...
...
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