- File:
-
- 1 edited
-
src/ResolvExpr/AlternativeFinder.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AlternativeFinder.cc
r1db306a r1389810 132 132 void printAlts( const AltList &list, std::ostream &os, unsigned int indentAmt ) { 133 133 Indenter indent = { indentAmt }; 134 135 std::vector<int> idx;136 idx.reserve(list.size());137 for(int i = 0; i < list.size(); i++) { idx.push_back(i); }138 139 std::sort(idx.begin(), idx.end(), [&list](int lhs_idx, int rhs_idx) -> bool {140 const auto & lhs = list.at(lhs_idx);141 const auto & rhs = list.at(rhs_idx);142 if(lhs.expr->location.startsBefore(rhs.expr->location)) return true;143 if(rhs.expr->location.startsBefore(lhs.expr->location)) return false;144 145 if(lhs.env.size() < rhs.env.size()) return true;146 if(lhs.env.size() > rhs.env.size()) return false;147 148 if(lhs.openVars.size() < rhs.openVars.size()) return true;149 if(lhs.openVars.size() > rhs.openVars.size()) return false;150 151 if(lhs.need.size() < rhs.need.size()) return true;152 if(lhs.need.size() > rhs.need.size()) return false;153 154 return false;155 });156 157 134 for ( AltList::const_iterator i = list.begin(); i != list.end(); ++i ) { 158 135 i->print( os, indent ); … … 1741 1718 std::cerr << std::endl; 1742 1719 ) 1743 1720 1744 1721 if ( thisCost != Cost::infinity ) { 1745 1722 // count one safe conversion for each value that is thrown away
Note:
See TracChangeset
for help on using the changeset viewer.