From 7487a7d92796b10ad0f9d93ee87b1319bb6ad970 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 12 Jan 2021 09:55:20 +0100 Subject: [PATCH] Use drop_exactly. --- libsolidity/analysis/TypeChecker.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 36cf90ab0..d0f86506f 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -1001,9 +1002,9 @@ void TypeChecker::endVisit(TryStatement const& _tryStatement) TryCatchClause const* panicClause = nullptr; TryCatchClause const* errorClause = nullptr; TryCatchClause const* lowLevelClause = nullptr; - for (size_t i = 1; i < _tryStatement.clauses().size(); ++i) + for (auto const& clausePointer: _tryStatement.clauses() | ranges::views::drop_exactly(1)) { - TryCatchClause const& clause = *_tryStatement.clauses()[i]; + TryCatchClause const& clause = *clausePointer; if (clause.errorName() == "") { if (lowLevelClause)