much smaller helper function

Signed-off-by: VoR0220 <rj@erisindustries.com>
This commit is contained in:
VoR0220 2017-01-10 07:15:48 -06:00
parent 79dbd40096
commit 8ace851831
No known key found for this signature in database
GPG Key ID: D4AB109D9B5D6386
2 changed files with 5 additions and 5 deletions

View File

@ -515,10 +515,8 @@ string CompilerStack::applyRemapping(string const& _path, string const& _context
for (auto const& redir: m_remappings)
{
filepath redirContext(redir.context);
filepath redirPrefix(redir.prefix);
string contextFileString = redirContext.generic_string();
string prefixFileString = redirPrefix.generic_string();
string contextFileString = sanitizePath(redir.context);
string prefixFileString = sanitizePath(redir.prefix);
// Skip if there is a prefix collision and the current context is closer
if (longestContext > 0 && contextFileString.length() < longestContext)
continue;

View File

@ -29,6 +29,7 @@
#include <vector>
#include <functional>
#include <boost/noncopyable.hpp>
#include <boost/filesystem.hpp>
#include <json/json.h>
#include <libdevcore/Common.h>
#include <libdevcore/FixedHash.h>
@ -239,7 +240,8 @@ private:
ContractDefinition const& _contract,
std::map<ContractDefinition const*, eth::Assembly const*>& _compiledContracts
);
/// Helper function to return path converted strings.
std::string sanitizePath(std::string const& _path) { return boost::filesystem::path(_path).generic_string(); }
void link();
Contract const& contract(std::string const& _contractName = "") const;