File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ void CSECodeGenerator::addDependencies(Id _c)
219
219
{
220
220
if (m_classPositions.count (_c))
221
221
return ; // it is already on the stack
222
- if (m_neededBy.count (_c))
222
+ if (m_neededBy.find (_c) != m_neededBy. end ( ))
223
223
return ; // we already computed the dependencies for _c
224
224
ExpressionClasses::Expression expr = m_expressionClasses.representative (_c);
225
225
assertThrow (expr.item , OptimizerException, " " );
@@ -300,8 +300,8 @@ void CSECodeGenerator::addDependencies(Id _c)
300
300
301
301
void CSECodeGenerator::generateClassElement (Id _c, bool _allowSequenced)
302
302
{
303
- for (auto it: m_classPositions)
304
- for (auto p: it.second )
303
+ for (auto const & it: m_classPositions)
304
+ for (int p: it.second )
305
305
if (p > m_stackHeight)
306
306
{
307
307
assertThrow (false , OptimizerException, " " );
Original file line number Diff line number Diff line change 24
24
25
25
#pragma once
26
26
27
- #include < vector>
28
27
#include < map>
28
+ #include < ostream>
29
29
#include < set>
30
30
#include < tuple>
31
- #include < ostream>
31
+ #include < unordered_map>
32
+ #include < vector>
32
33
#include < libsolutil/CommonIO.h>
33
34
#include < libsolutil/Exceptions.h>
34
35
#include < libevmasm/ExpressionClasses.h>
@@ -154,11 +155,11 @@ class CSECodeGenerator
154
155
// / Current height of the stack relative to the start.
155
156
int m_stackHeight = 0 ;
156
157
// / If (b, a) is in m_requests then b is needed to compute a.
157
- std::multimap <Id, Id> m_neededBy;
158
+ std::unordered_multimap <Id, Id> m_neededBy;
158
159
// / Current content of the stack.
159
160
std::map<int , Id> m_stack;
160
161
// / Current positions of equivalence classes, equal to the empty set if already deleted.
161
- std::map <Id, std::set<int >> m_classPositions;
162
+ std::unordered_map <Id, std::set<int >> m_classPositions;
162
163
163
164
// / The actual equivalence class items and how to compute them.
164
165
ExpressionClasses& m_expressionClasses;
You can’t perform that action at this time.
0 commit comments