Reduce unnecessary uses of std::list

This commit is contained in:
Michael Hansen
2022-12-01 11:35:14 -08:00
parent 863e09e9e7
commit 93495c3bfb
7 changed files with 54 additions and 78 deletions

View File

@@ -2,7 +2,7 @@
#define _PYC_MODULE_H
#include "pyc_code.h"
#include <list>
#include <vector>
enum PycMagic {
MAGIC_1_0 = 0x00999902,
@@ -64,10 +64,10 @@ public:
PycRef<PycCode> code() const { return m_code; }
void intern(PycRef<PycString> str) { m_interns.push_back(str); }
void intern(PycRef<PycString> str) { m_interns.emplace_back(std::move(str)); }
PycRef<PycString> getIntern(int ref) const;
void refObject(PycRef<PycObject> str) { m_refs.push_back(str); }
void refObject(PycRef<PycObject> obj) { m_refs.emplace_back(std::move(obj)); }
PycRef<PycObject> getRef(int ref) const;
static bool isSupportedVersion(int major, int minor);
@@ -80,8 +80,8 @@ private:
bool m_unicode;
PycRef<PycCode> m_code;
std::list<PycRef<PycString> > m_interns;
std::list<PycRef<PycObject> > m_refs;
std::vector<PycRef<PycString>> m_interns;
std::vector<PycRef<PycObject>> m_refs;
};
#endif