MCPcopy Create free account
hub / github.com/argotorg/solidity / encodeSubPath

Method encodeSubPath

libevmasm/Assembly.cpp:1829–1846  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1827}
1828
1829SubAssemblyID Assembly::encodeSubPath(std::vector<SubAssemblyID> const& _subPath)
1830{
1831 assertThrow(!_subPath.empty(), AssemblyException, "");
1832 if (_subPath.size() == 1)
1833 {
1834 solAssert(_subPath[0].value < m_subs.size());
1835 return _subPath[0];
1836 }
1837
1838 if (!m_subPaths.contains(_subPath))
1839 {
1840 SubAssemblyID const objectId{std::numeric_limits<SubAssemblyID::ValueType>::max() - m_subPaths.size()};
1841 solAssert(objectId.value >= m_subs.size());
1842 m_subPaths[_subPath] = objectId;
1843 }
1844
1845 return m_subPaths[_subPath];
1846}
1847
1848Assembly const* Assembly::subAssemblyById(SubAssemblyID const _subId) const
1849{

Callers 4

BOOST_AUTO_TEST_CASEFunction · 0.80
appendDataOffsetMethod · 0.80
appendDataSizeMethod · 0.80

Calls 3

emptyMethod · 0.45
sizeMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected