aboutsummaryrefslogtreecommitdiff
path: root/src/io/InputFragment.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/InputFragment.cxx')
-rw-r--r--src/io/InputFragment.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/io/InputFragment.cxx b/src/io/InputFragment.cxx
index 595b88b1..827aa372 100644
--- a/src/io/InputFragment.cxx
+++ b/src/io/InputFragment.cxx
@@ -76,16 +76,18 @@ namespace OpenAxiom {
// Return true if line is entirely a positive comment, i.e. a description.
static bool positive_comment(const Line& line) {
- if (line.indent + 1 >= line.length())
+ std::size_t i = line.indent + 1;
+ if (i >= line.length())
return false;
- return line[line.indent] == '+' and line[line.indent + 1] == '+';
+ return line[line.indent] == '+' and line[i] == '+';
}
// Return true if line is entirely a negative comment.
static bool negative_comment(const Line& line) {
- if (line.indent + 1 >= line.length())
+ std::size_t i = line.indent + 1;
+ if (i >= line.length())
return false;
- return line[line.indent] == '-' and line[line.indent + 1] == '-';
+ return line[line.indent] == '-' and line[i] == '-';
}
// Clean up and dress up the line with indentation information.