summaryrefslogtreecommitdiff
path: root/dviware/dvisvgm/src/GraphicsPath.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'dviware/dvisvgm/src/GraphicsPath.hpp')
-rw-r--r--dviware/dvisvgm/src/GraphicsPath.hpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/dviware/dvisvgm/src/GraphicsPath.hpp b/dviware/dvisvgm/src/GraphicsPath.hpp
index 64c112ad0b..a0c9f8ab8f 100644
--- a/dviware/dvisvgm/src/GraphicsPath.hpp
+++ b/dviware/dvisvgm/src/GraphicsPath.hpp
@@ -2,7 +2,7 @@
** GraphicsPath.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2021 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -20,6 +20,7 @@
#pragma once
+#include <algorithm>
#include <array>
#include <cctype>
#include <cmath>
@@ -662,24 +663,14 @@ class GraphicsPath {
bool operator == (const GraphicsPath &path) const {
if (size() != path.size())
return false;
- auto it = _commands.begin();
- for (const auto &cmd : path._commands) {
- if (*it++ != cmd)
- return false;
- }
- return true;
+ return std::equal(_commands.begin(), _commands.end(), path._commands.begin());
}
/** Returns true if this path differs from another one (command-wise). */
bool operator != (const GraphicsPath &path) const {
if (size() != path.size())
return true;
- auto it = _commands.begin();
- for (const auto &cmd : path._commands) {
- if (*it++ != cmd)
- return true;
- }
- return false;
+ return !std::equal(_commands.begin(), _commands.end(), path._commands.begin());
}
/** Iterates over all commands defining this path and calls the corresponding template methods.