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
ef71d453
Commit
ef71d453
authored
Jul 18, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some ContiguousMap additions/fixes
parent
d78db72a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
src/core/contiguous_map.h
src/core/contiguous_map.h
+5
-5
src/runtime/types.h
src/runtime/types.h
+1
-1
No files found.
src/core/contiguous_map.h
View file @
ef71d453
...
...
@@ -43,12 +43,11 @@ public:
const_iterator
begin
()
const
noexcept
{
return
map
.
begin
();
}
const_iterator
end
()
const
noexcept
{
return
map
.
end
();
}
iterator
erase
(
const_iterator
position
)
{
void
erase
(
const_iterator
position
)
{
int
idx
=
map
[
position
->
first
];
free_list
.
push_back
(
idx
);
vec
[
idx
]
=
TVal
();
map
.
erase
(
position
->
first
);
return
begin
();
// this is broken...
}
size_type
erase
(
const
TKey
&
key
)
{
...
...
@@ -73,9 +72,9 @@ public:
free_list
.
pop_back
();
}
else
{
idx
=
vec
.
size
();
vec
.
push_back
(
TVal
());
}
map
[
key
]
=
idx
;
vec
.
push_back
(
TVal
());
return
vec
[
idx
];
}
else
{
return
vec
[
it
->
second
];
...
...
@@ -91,9 +90,9 @@ public:
free_list
.
pop_back
();
}
else
{
idx
=
vec
.
size
();
vec
.
push_back
(
TVal
());
}
map
[
key
]
=
idx
;
vec
.
push_back
(
TVal
());
return
vec
[
idx
];
}
else
{
return
vec
[
it
->
second
];
...
...
@@ -102,7 +101,8 @@ public:
TVal
getMapped
(
int
idx
)
const
{
return
vec
[
idx
];
}
size_type
size
()
const
{
return
vec
.
size
();
}
size_type
size
()
const
{
return
map
.
size
();
}
bool
empty
()
const
{
return
map
.
empty
();
}
const
vec_type
&
vector
()
{
return
vec
;
}
};
}
...
...
src/runtime/types.h
View file @
ef71d453
...
...
@@ -374,7 +374,7 @@ public:
// in the attr_offssets map.
// Also, if we have any children, we can skip scanning our attr_offsets map, since it will be a subset
// of our child's map.
if
(
!
children
.
size
())
if
(
children
.
empty
())
for
(
auto
p
:
attr_offsets
)
visitor
->
visit
(
p
.
first
);
}
...
...
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