From 26f3a8476fd54833dd9d2f29433a1dd5660ffad6 Mon Sep 17 00:00:00 2001 From: Tristan Penman Date: Sat, 6 Nov 2021 08:44:09 +1100 Subject: [PATCH] Less const-ness --- include/valijson/exceptions.hpp | 4 +--- include/valijson/schema_parser.hpp | 2 +- include/valijson/validation_visitor.hpp | 6 +++--- include/valijson/validator.hpp | 3 +-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/valijson/exceptions.hpp b/include/valijson/exceptions.hpp index a418825..3ddd5a9 100644 --- a/include/valijson/exceptions.hpp +++ b/include/valijson/exceptions.hpp @@ -33,9 +33,7 @@ VALIJSON_NORETURN inline void throwLogicError(const std::string& msg) { #endif VALIJSON_NORETURN inline void throwNotSupported() { - throwRuntimeError("Not supported"); \ + throwRuntimeError("Not supported"); } } // namespace valijson - - diff --git a/include/valijson/schema_parser.hpp b/include/valijson/schema_parser.hpp index aeff342..05dcfc2 100644 --- a/include/valijson/schema_parser.hpp +++ b/include/valijson/schema_parser.hpp @@ -2291,7 +2291,7 @@ private: private: /// Version of JSON Schema that should be expected when parsing - const Version m_version; + Version m_version; }; } // namespace valijson diff --git a/include/valijson/validation_visitor.hpp b/include/valijson/validation_visitor.hpp index cd4442d..16db8c1 100644 --- a/include/valijson/validation_visitor.hpp +++ b/include/valijson/validation_visitor.hpp @@ -1770,16 +1770,16 @@ private: } /// The JSON value being validated - const AdapterType m_target; + AdapterType m_target; /// Vector of strings describing the current object context - const std::vector m_context; + std::vector m_context; /// Optional pointer to a ValidationResults object to be populated ValidationResults *m_results; /// Option to use strict type comparison - const bool m_strictTypes; + bool m_strictTypes; /// Cached regex objects for pattern constraint std::unordered_map& m_regexesCache; diff --git a/include/valijson/validator.hpp b/include/valijson/validator.hpp index b26f625..b60c593 100644 --- a/include/valijson/validator.hpp +++ b/include/valijson/validator.hpp @@ -67,11 +67,10 @@ public: private: /// Flag indicating that strict type comparisons should be used - const bool strictTypes; + bool strictTypes; /// Cached regex objects for pattern constraint. Key - pattern. std::unordered_map regexesCache; - }; } // namespace valijson