diff options
author | chriseth <c@ethdev.com> | 2016-04-01 06:54:07 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-04-01 06:54:12 +0800 |
commit | ea7325d2d2716703d458f520e3cc48a421730094 (patch) | |
tree | 429d6844def9c560e610d30a0ab69920cf5ac466 /test/libsolidity | |
parent | c67926cf2be95e9275eb2b7fe904131e7e8842ad (diff) | |
download | dexon-solidity-ea7325d2d2716703d458f520e3cc48a421730094.tar.gz dexon-solidity-ea7325d2d2716703d458f520e3cc48a421730094.tar.zst dexon-solidity-ea7325d2d2716703d458f520e3cc48a421730094.zip |
Remove code duplication in source references formatter.
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/GasMeter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp index 9f947af3..ebd5d774 100644 --- a/test/libsolidity/GasMeter.cpp +++ b/test/libsolidity/GasMeter.cpp @@ -120,8 +120,9 @@ BOOST_AUTO_TEST_CASE(non_overlapping_filtered_costs) if (first->first->location().intersects(second->first->location())) { BOOST_CHECK_MESSAGE(false, "Source locations should not overlap!"); - SourceReferenceFormatter::printSourceLocation(cout, first->first->location(), m_compiler.scanner()); - SourceReferenceFormatter::printSourceLocation(cout, second->first->location(), m_compiler.scanner()); + auto scannerFromSource = [&](string const&) -> Scanner const& { return m_compiler.scanner(); }; + SourceReferenceFormatter::printSourceLocation(cout, &first->first->location(), scannerFromSource); + SourceReferenceFormatter::printSourceLocation(cout, &second->first->location(), scannerFromSource); } } } |