[flang] Address review comments
authorTim Keith <tkeith@nvidia.com>
Tue, 19 Mar 2019 21:18:44 +0000 (14:18 -0700)
committerTim Keith <tkeith@nvidia.com>
Tue, 19 Mar 2019 21:18:44 +0000 (14:18 -0700)
Original-commit: flang-compiler/f18@511c9ec536b6a529a5111b2e502c738505faf91b
Reviewed-on: https://github.com/flang-compiler/f18/pull/343

flang/lib/parser/basic-parsers.h

index d70b8d6..cabc36b 100644 (file)
@@ -1344,11 +1344,9 @@ public:
     auto result{parser_.Parse(state)};
     if (result.has_value()) {
       const char *end{state.GetLocation()};
-      if (start < end && start[0] == ' ') {
-        ++start;
+      for (; start < end && start[0] == ' '; ++start) {
       }
-      if (start < end && end[-1] == ' ') {
-        --end;
+      for (; start < end && end[-1] == ' '; --end) {
       }
       result->source = CharBlock{start, end};
     }