mirror of
https://github.com/zrax/pycdc.git
synced 2026-06-23 11:34:07 +00:00
Keep PycSet objects marshalled from files in order too
This commit is contained in:
parent
ded8adfba2
commit
1fcbf4cd4b
3 changed files with 4 additions and 18 deletions
|
|
@ -134,7 +134,7 @@ void PycSet::load(PycData* stream, PycModule* mod)
|
|||
{
|
||||
m_size = stream->get32();
|
||||
for (int i=0; i<m_size; i++)
|
||||
m_values.insert(LoadObject(stream, mod));
|
||||
m_values.push_back(LoadObject(stream, mod));
|
||||
}
|
||||
|
||||
bool PycSet::isEqual(PycRef<PycObject> obj) const
|
||||
|
|
@ -154,16 +154,3 @@ bool PycSet::isEqual(PycRef<PycObject> obj) const
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
PycRef<PycObject> PycSet::get(int idx) const
|
||||
{
|
||||
if (idx < 0)
|
||||
throw std::out_of_range("Set index out of range");
|
||||
|
||||
auto it = m_values.cbegin();
|
||||
while (idx-- && it != m_values.cend())
|
||||
++it;
|
||||
if (it == m_values.cend())
|
||||
throw std::out_of_range("Set index out of range");
|
||||
return *it;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue