forked from lix-project/lix
Simplify loop, feedback from @tfc and @Ericson2314
This commit is contained in:
parent
7b122d43a4
commit
8618c6cc75
|
@ -265,11 +265,11 @@ std::ostream & showErrorInfo(std::ostream & out, const ErrorInfo & einfo, bool s
|
||||||
|
|
||||||
// traces
|
// traces
|
||||||
if (showTrace && !einfo.traces.empty()) {
|
if (showTrace && !einfo.traces.empty()) {
|
||||||
for (auto iter = einfo.traces.begin(); iter != einfo.traces.end(); ++iter) {
|
for (const auto & trace : einfo.traces) {
|
||||||
oss << "\n" << "… " << iter->hint.str() << "\n";
|
oss << "\n" << "… " << trace.hint.str() << "\n";
|
||||||
|
|
||||||
if (iter->pos.has_value() && (*iter->pos)) {
|
if (trace.pos.has_value() && (*trace.pos)) {
|
||||||
auto pos = iter->pos.value();
|
auto pos = trace.pos.value();
|
||||||
oss << "\n";
|
oss << "\n";
|
||||||
printAtPos(pos, oss);
|
printAtPos(pos, oss);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue