@@ -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
}
@@ -526,8 +526,8 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
526
526
if (_json.isMember (" sourceList" ))
527
527
{
528
528
solRequire (_json[" sourceList" ].isArray (), AssemblyImportException, " Optional member 'sourceList' is not an array." );
529
- for (Json::Value const & sourceListItem : _json[" sourceList" ])
530
- solRequire (sourceListItem .isString (), AssemblyImportException, " The 'sourceList' array contains an item that is not a string." );
529
+ for (Json::Value const & sourceName : _json[" sourceList" ])
530
+ solRequire (sourceName .isString (), AssemblyImportException, " The 'sourceList' array contains an item that is not a string." );
531
531
}
532
532
}
533
533
else
@@ -542,14 +542,14 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
542
542
if (_json.isMember (" sourceList" ))
543
543
{
544
544
solAssert (_level == 0 );
545
- for (Json::Value const & it : _json[" sourceList" ])
545
+ for (Json::Value const & sourceName : _json[" sourceList" ])
546
546
{
547
547
solRequire (
548
- std::find (sourceList.begin (), sourceList.end (), it .asString ()) == sourceList.end (),
548
+ std::find (sourceList.begin (), sourceList.end (), sourceName .asString ()) == sourceList.end (),
549
549
AssemblyImportException,
550
550
" Items in 'sourceList' array are not unique."
551
551
);
552
- sourceList.emplace_back (it .asString ());
552
+ sourceList.emplace_back (sourceName .asString ());
553
553
}
554
554
}
555
555
else
@@ -571,22 +571,22 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
571
571
{
572
572
solRequire (dataIter.key ().isString (), AssemblyImportException, " Key inside '.data' is not a string." );
573
573
std::string dataItemID = dataIter.key ().asString ();
574
- Json::Value const & code = data[dataItemID];
575
- if (code .isString ())
574
+ Json::Value const & dataItem = data[dataItemID];
575
+ if (dataItem .isString ())
576
576
{
577
577
solRequire (
578
- code .asString ().empty () || !fromHex (code .asString ()).empty (),
578
+ dataItem .asString ().empty () || !fromHex (dataItem .asString ()).empty (),
579
579
AssemblyImportException,
580
580
" The value for key '" + dataItemID + " ' inside '.data' is not a valid hexadecimal string."
581
581
);
582
- result->m_data [h256 (fromHex (dataItemID))] = fromHex (code .asString ());
582
+ result->m_data [h256 (fromHex (dataItemID))] = fromHex (dataItem .asString ());
583
583
}
584
- else if (code .isObject ())
584
+ else if (dataItem .isObject ())
585
585
{
586
586
size_t index = static_cast <size_t >(std::stoi (dataItemID));
587
587
if (result->m_subs .size () <= index)
588
588
result->m_subs .resize (index + 1 );
589
- std::shared_ptr<Assembly> subassembly (Assembly::fromJSON (code , sourceList, _level + 1 ).first );
589
+ std::shared_ptr<Assembly> subassembly (Assembly::fromJSON (dataItem , sourceList, _level + 1 ).first );
590
590
solAssert (subassembly);
591
591
result->m_subs [index] = subassembly;
592
592
}
0 commit comments