@@ -81,15 +81,15 @@ void Assembly::importAssemblyItemsFromJSON(Json::Value const& _code, std::vector
81
81
{
82
82
solAssert (m_items.empty ());
83
83
solRequire (_code.isArray (), AssemblyImportException, " Supplied JSON is not an array." );
84
- for (auto current = std::begin (_code); current != std::end (_code); ++current )
84
+ for (auto jsonItemIter = std::begin (_code); jsonItemIter != std::end (_code); ++jsonItemIter )
85
85
{
86
- AssemblyItem const & item = m_items.emplace_back (createAssemblyItemFromJSON (*current , _sourceList));
87
- if (item == Instruction::JUMPDEST)
86
+ AssemblyItem const & newItem = m_items.emplace_back (createAssemblyItemFromJSON (*jsonItemIter , _sourceList));
87
+ if (newItem == Instruction::JUMPDEST)
88
88
solThrow (AssemblyImportException, " JUMPDEST instruction without a tag" );
89
- else if (item .type () == AssemblyItemType::Tag)
89
+ else if (newItem .type () == AssemblyItemType::Tag)
90
90
{
91
- ++current ;
92
- if (current != std::end (_code) && createAssemblyItemFromJSON (*current , _sourceList) != Instruction::JUMPDEST)
91
+ ++jsonItemIter ;
92
+ if (jsonItemIter != std::end (_code) && createAssemblyItemFromJSON (*jsonItemIter , _sourceList) != Instruction::JUMPDEST)
93
93
solThrow (AssemblyImportException, " JUMPDEST expected after tag." );
94
94
}
95
95
}
@@ -530,8 +530,8 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
530
530
if (_json.isMember (" sourceList" ))
531
531
{
532
532
solRequire (_json[" sourceList" ].isArray (), AssemblyImportException, " Optional member 'sourceList' is not an array." );
533
- for (Json::Value const & sourceListItem : _json[" sourceList" ])
534
- solRequire (sourceListItem .isString (), AssemblyImportException, " The 'sourceList' array contains an item that is not a string." );
533
+ for (Json::Value const & sourceName : _json[" sourceList" ])
534
+ solRequire (sourceName .isString (), AssemblyImportException, " The 'sourceList' array contains an item that is not a string." );
535
535
}
536
536
}
537
537
else
@@ -545,14 +545,14 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
545
545
if (_json.isMember (" sourceList" ))
546
546
{
547
547
solAssert (_level == 0 );
548
- for (Json::Value const & it : _json[" sourceList" ])
548
+ for (Json::Value const & sourceName : _json[" sourceList" ])
549
549
{
550
550
solRequire (
551
- std::find (sourceList.begin (), sourceList.end (), it .asString ()) == sourceList.end (),
551
+ std::find (sourceList.begin (), sourceList.end (), sourceName .asString ()) == sourceList.end (),
552
552
AssemblyImportException,
553
553
" Items in 'sourceList' array are not unique."
554
554
);
555
- sourceList.emplace_back (it .asString ());
555
+ sourceList.emplace_back (sourceName .asString ());
556
556
}
557
557
}
558
558
else
@@ -574,22 +574,22 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
574
574
{
575
575
solRequire (dataIter.key ().isString (), AssemblyImportException, " Key inside '.data' is not a string." );
576
576
std::string dataItemID = dataIter.key ().asString ();
577
- Json::Value const & code = data[dataItemID];
578
- if (code .isString ())
577
+ Json::Value const & dataItem = data[dataItemID];
578
+ if (dataItem .isString ())
579
579
{
580
580
solRequire (
581
- code .asString ().empty () || !fromHex (code .asString ()).empty (),
581
+ dataItem .asString ().empty () || !fromHex (dataItem .asString ()).empty (),
582
582
AssemblyImportException,
583
583
" Member '.data' contains a value for '" + dataItemID + " ' that is not a valid hexadecimal string."
584
584
);
585
- result->m_data [h256 (fromHex (dataItemID))] = fromHex (code .asString ());
585
+ result->m_data [h256 (fromHex (dataItemID))] = fromHex (dataItem .asString ());
586
586
}
587
- else if (code .isObject ())
587
+ else if (dataItem .isObject ())
588
588
{
589
589
size_t index = static_cast <size_t >(std::stoi (dataItemID));
590
590
if (result->m_subs .size () <= index)
591
591
result->m_subs .resize (index + 1 );
592
- std::shared_ptr<Assembly> subassembly (Assembly::fromJSON (code , sourceList, _level + 1 ).first );
592
+ std::shared_ptr<Assembly> subassembly (Assembly::fromJSON (dataItem , sourceList, _level + 1 ).first );
593
593
solAssert (subassembly);
594
594
result->m_subs [index] = subassembly;
595
595
}
0 commit comments