From cd84587c3a83db422b9718b033f50043771f8946 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 1 Oct 2016 18:03:44 -0700 Subject: [PATCH] Fix a "loop will execute at most once" warning --- src/builtin_test.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/builtin_test.cpp b/src/builtin_test.cpp index 09d7337b4..44290b031 100644 --- a/src/builtin_test.cpp +++ b/src/builtin_test.cpp @@ -545,12 +545,11 @@ expression *test_parser::parse_args(const wcstring_list_t &args, wcstring &err) expression *result = parser.parse_expression(0, (unsigned int)args.size()); // Handle errors. - for (size_t i = 0; i < parser.errors.size(); i++) { + // For now we only show the first error. + if (! parser.errors.empty()) { err.append(L"test: "); - err.append(parser.errors.at(i)); + err.append(parser.errors.at(0)); err.push_back(L'\n'); - // For now we only show the first error. - break; } if (result) {