Skip to content

Commit

Permalink
Stylistic corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
roadriverrail authored and Rhett Aultman committed Jan 16, 2017
1 parent 220ccfb commit 0c98e4b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion libsolidity/ast/AST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void ContractDefinition::setUserDocumentation(Json::Value const& _userDocumentat
}


std::string ContractDefinition::fullyQualifiedName() const
string ContractDefinition::fullyQualifiedName() const
{
std::string sourceString = *(location().sourceName);
std::string qualifiedName = (sourceString.empty() ? ("") : (sourceString + ":")) + name();
Expand Down
12 changes: 4 additions & 8 deletions libsolidity/interface/CompilerStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ bool CompilerStack::parse()

if (m_contracts.find(contract->fullyQualifiedName()) != m_contracts.end())
{
const ContractDefinition* existingContract = m_contracts.find(contract->fullyQualifiedName())->second.contract;
ContractDefinition const* existingContract = m_contracts[contract->fullyQualifiedName()].contract;
if (contract != existingContract)
{
auto err = make_shared<Error>(Error::Type::DeclarationError);
Expand All @@ -201,9 +201,7 @@ bool CompilerStack::parse()
}
}
else
{
m_contracts[contract->fullyQualifiedName()].contract = contract;
}
}

if (!checkLibraryNameClashes())
Expand All @@ -224,9 +222,10 @@ bool CompilerStack::parse()
else
noErrors = false;

// Note that find() must be used here to prevent an automatic insert into the map
if (m_contracts.find(contract->fullyQualifiedName()) != m_contracts.end())
{
const ContractDefinition* existingContract = m_contracts.find(contract->fullyQualifiedName())->second.contract;
ContractDefinition const* existingContract = m_contracts[contract->fullyQualifiedName()].contract;

if (contract != existingContract)
{
Expand All @@ -245,9 +244,7 @@ bool CompilerStack::parse()

}
else
{
m_contracts[contract->fullyQualifiedName()].contract = contract;
}
}

if (noErrors)
Expand Down Expand Up @@ -379,8 +376,7 @@ std::string const CompilerStack::filesystemFriendlyName(string const& _contractN
}
}
// If no collision, return the contract's name
// String is copied to ensure that the contract's name can't be messed with
return std::string(matchContract.contract->name());
return matchContract.contract->name();
}

eth::LinkerObject const& CompilerStack::object(string const& _contractName) const
Expand Down
2 changes: 0 additions & 2 deletions solc/CommandLineInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ void CommandLineInterface::handleBinary(string const& _contract)
if (m_args.count(g_argBinary))
{
if (m_args.count("output-dir"))
{
createFile(m_compiler->filesystemFriendlyName(_contract) + ".bin", m_compiler->object(_contract).toHex());
}
else
{
cout << "Binary: " << endl;
Expand Down

0 comments on commit 0c98e4b

Please sign in to comment.