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
1206cf29
Commit
1206cf29
authored
Aug 09, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
microoptimizations
parent
85a1c69b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
src/runtime/set.cpp
src/runtime/set.cpp
+0
-3
src/runtime/tuple.cpp
src/runtime/tuple.cpp
+11
-5
No files found.
src/runtime/set.cpp
View file @
1206cf29
...
...
@@ -515,9 +515,6 @@ Box* setUnion(BoxedSet* self, BoxedTuple* args) {
BoxedSet
*
rtn
=
makeNewSet
(
self
->
cls
,
self
);
AUTO_DECREF
(
rtn
);
for
(
auto
&&
p
:
self
->
s
)
_setAdd
(
rtn
,
p
);
for
(
auto
container
:
args
->
pyElements
())
{
AUTO_DECREF
(
container
);
for
(
auto
elt
:
container
->
pyElements
())
{
...
...
src/runtime/tuple.cpp
View file @
1206cf29
...
...
@@ -265,7 +265,7 @@ Box* tupleRepr(Box* _t) {
BoxedTuple
*
t
=
(
BoxedTuple
*
)
_t
;
int
n
;
std
::
vector
<
char
>
chars
;
llvm
::
SmallVector
<
char
,
128
>
chars
;
int
status
=
Py_ReprEnter
((
PyObject
*
)
t
);
n
=
t
->
size
();
if
(
n
==
0
)
{
...
...
@@ -427,7 +427,7 @@ extern "C" Box* tupleNew(Box* _cls, BoxedTuple* args, BoxedDict* kwargs) {
return
r
;
}
std
::
vector
<
Box
*
>
elts
;
llvm
::
SmallVector
<
Box
*
,
16
>
elts
;
try
{
for
(
auto
e
:
elements
->
pyElements
())
elts
.
push_back
(
e
);
...
...
@@ -437,10 +437,16 @@ extern "C" Box* tupleNew(Box* _cls, BoxedTuple* args, BoxedDict* kwargs) {
throw
e
;
}
if
(
elts
.
empty
())
{
if
(
cls
==
tuple_cls
)
return
incref
(
EmptyTuple
);
return
BoxedTuple
::
create
(
0
,
cls
);
}
else
{
auto
rtn
=
BoxedTuple
::
create
(
elts
.
size
(),
cls
);
memcpy
(
&
rtn
->
elts
[
0
],
&
elts
[
0
],
elts
.
size
()
*
sizeof
(
Box
*
));
return
rtn
;
}
}
else
{
if
(
cls
==
tuple_cls
)
return
incref
(
EmptyTuple
);
...
...
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