Use deque instead of set
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "pyc_module.h"
|
||||
#include <list>
|
||||
#include <deque>
|
||||
|
||||
/* Similar interface to PycObject, so PycRef can work on it... *
|
||||
* However, this does *NOT* mean the two are interchangeable! */
|
||||
@@ -360,7 +361,7 @@ private:
|
||||
|
||||
class ASTSet : public ASTNode {
|
||||
public:
|
||||
typedef std::set<PycRef<ASTNode>> value_t;
|
||||
typedef std::deque<PycRef<ASTNode>> value_t;
|
||||
|
||||
ASTSet(value_t values)
|
||||
: ASTNode(NODE_SET), m_values(std::move(values)) { }
|
||||
|
@@ -326,7 +326,7 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
|
||||
{
|
||||
ASTSet::value_t values;
|
||||
for (int i=0; i<operand; i++) {
|
||||
values.insert(stack.top());
|
||||
values.push_front(stack.top());
|
||||
stack.pop();
|
||||
}
|
||||
stack.push(new ASTSet(values));
|
||||
@@ -1578,7 +1578,7 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
|
||||
|
||||
ASTSet::value_t result = lhs->values();
|
||||
for (const auto& it : obj.cast<PycSet>()->values()) {
|
||||
result.insert(new ASTObject(it));
|
||||
result.push_back(new ASTObject(it));
|
||||
}
|
||||
|
||||
stack.push(new ASTSet(result));
|
||||
|
Reference in New Issue
Block a user