Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
4edaa1e2
Commit
4edaa1e2
authored
Mar 25, 2015
by
Chris Toshok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ensure the lists are properly sized when we know what their size will be
parent
3431e9a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
src/runtime/dict.cpp
src/runtime/dict.cpp
+3
-0
src/runtime/traceback.cpp
src/runtime/traceback.cpp
+1
-0
No files found.
src/runtime/dict.cpp
View file @
4edaa1e2
...
...
@@ -67,6 +67,7 @@ Box* dictCopy(BoxedDict* self) {
Box
*
dictItems
(
BoxedDict
*
self
)
{
BoxedList
*
rtn
=
new
BoxedList
();
rtn
->
ensure
(
self
->
d
.
size
());
for
(
const
auto
&
p
:
self
->
d
)
{
BoxedTuple
::
GCVector
elts
;
elts
.
push_back
(
p
.
first
);
...
...
@@ -80,6 +81,7 @@ Box* dictItems(BoxedDict* self) {
Box
*
dictValues
(
BoxedDict
*
self
)
{
BoxedList
*
rtn
=
new
BoxedList
();
rtn
->
ensure
(
self
->
d
.
size
());
for
(
const
auto
&
p
:
self
->
d
)
{
listAppendInternal
(
rtn
,
p
.
second
);
}
...
...
@@ -90,6 +92,7 @@ Box* dictKeys(BoxedDict* self) {
RELEASE_ASSERT
(
isSubclass
(
self
->
cls
,
dict_cls
),
""
);
BoxedList
*
rtn
=
new
BoxedList
();
rtn
->
ensure
(
self
->
d
.
size
());
for
(
const
auto
&
p
:
self
->
d
)
{
listAppendInternal
(
rtn
,
p
.
first
);
}
...
...
src/runtime/traceback.cpp
View file @
4edaa1e2
...
...
@@ -96,6 +96,7 @@ Box* BoxedTraceback::getLines(Box* b) {
if
(
!
tb
->
py_lines
)
{
BoxedList
*
lines
=
new
BoxedList
();
lines
->
ensure
(
tb
->
lines
.
size
());
for
(
auto
line
:
tb
->
lines
)
{
auto
l
=
new
BoxedTuple
({
boxString
(
line
->
file
),
boxString
(
line
->
func
),
boxInt
(
line
->
line
)
});
listAppendInternal
(
lines
,
l
);
...
...
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