From f00921d3d37e8cd3fc3da088028fa952538c34d0 Mon Sep 17 00:00:00 2001 From: Akash Munagala Date: Mon, 13 Feb 2023 19:25:45 -0800 Subject: [PATCH] Use deque instead of set --- ASTNode.h | 3 ++- ASTree.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ASTNode.h b/ASTNode.h index 8ac6e1c..8d5079a 100644 --- a/ASTNode.h +++ b/ASTNode.h @@ -3,6 +3,7 @@ #include "pyc_module.h" #include +#include /* 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> value_t; + typedef std::deque> value_t; ASTSet(value_t values) : ASTNode(NODE_SET), m_values(std::move(values)) { } diff --git a/ASTree.cpp b/ASTree.cpp index a95b8ef..7af32d9 100644 --- a/ASTree.cpp +++ b/ASTree.cpp @@ -326,7 +326,7 @@ PycRef BuildFromCode(PycRef code, PycModule* mod) { ASTSet::value_t values; for (int i=0; i BuildFromCode(PycRef code, PycModule* mod) ASTSet::value_t result = lhs->values(); for (const auto& it : obj.cast()->values()) { - result.insert(new ASTObject(it)); + result.push_back(new ASTObject(it)); } stack.push(new ASTSet(result));