Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
transaction
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
transaction
Commits
b42a65c5
Commit
b42a65c5
authored
Apr 24, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Micro-optimization
parent
5758557c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
transaction/weakset.py
transaction/weakset.py
+6
-3
No files found.
transaction/weakset.py
View file @
b42a65c5
...
...
@@ -75,9 +75,12 @@ class WeakSet(object):
# elements are actually trash. By returning a list of weakrefs instead,
# we avoid that, although the decision to use weakrefs is now very
# visible to our clients.
def
as_weakref_list
(
self
):
if
PY3
:
#pragma: no cover (coverage tests run under 2.7)
# Python 3: be sure to freeze the iterator, to avoid RuntimeError:
# dictionary changed size during iteration.
def
as_weakref_list
(
self
):
return
list
(
self
.
data
.
valuerefs
())
else
:
# On Python2 we already get a list, no need to copy
refs
=
self
.
data
.
valuerefs
()
return
list
(
refs
)
if
PY3
else
refs
def
as_weakref_list
(
self
):
return
self
.
data
.
valuerefs
()
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