aboutsummaryrefslogtreecommitdiff
path: root/src/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/common.h b/src/common.h
index a932f3b..8d358cb 100644
--- a/src/common.h
+++ b/src/common.h
@@ -24,15 +24,14 @@ struct line_view {
bool operator==(const line_view& lv) const noexcept {
const char* p1 = line;
const char* p2 = lv.line;
+ const char* p3 = p1 + length;
if (length != lv.length) {
return false;
}
- while (p1 < p1 + length) {
- if (*p1 != *p2) {
+ while (p1 < p3) {
+ if (*p1++ != *p2++) {
return false;
}
- p1++;
- p2++;
}
return true;
}