Less const-ness

This commit is contained in:
Tristan Penman 2021-11-06 08:44:09 +11:00
parent 3eaf1bb93e
commit 26f3a8476f
4 changed files with 6 additions and 9 deletions

View File

@ -33,9 +33,7 @@ VALIJSON_NORETURN inline void throwLogicError(const std::string& msg) {
#endif #endif
VALIJSON_NORETURN inline void throwNotSupported() { VALIJSON_NORETURN inline void throwNotSupported() {
throwRuntimeError("Not supported"); \ throwRuntimeError("Not supported");
} }
} // namespace valijson } // namespace valijson

View File

@ -2291,7 +2291,7 @@ private:
private: private:
/// Version of JSON Schema that should be expected when parsing /// Version of JSON Schema that should be expected when parsing
const Version m_version; Version m_version;
}; };
} // namespace valijson } // namespace valijson

View File

@ -1770,16 +1770,16 @@ private:
} }
/// The JSON value being validated /// The JSON value being validated
const AdapterType m_target; AdapterType m_target;
/// Vector of strings describing the current object context /// Vector of strings describing the current object context
const std::vector<std::string> m_context; std::vector<std::string> m_context;
/// Optional pointer to a ValidationResults object to be populated /// Optional pointer to a ValidationResults object to be populated
ValidationResults *m_results; ValidationResults *m_results;
/// Option to use strict type comparison /// Option to use strict type comparison
const bool m_strictTypes; bool m_strictTypes;
/// Cached regex objects for pattern constraint /// Cached regex objects for pattern constraint
std::unordered_map<std::string, std::regex>& m_regexesCache; std::unordered_map<std::string, std::regex>& m_regexesCache;

View File

@ -67,11 +67,10 @@ public:
private: private:
/// Flag indicating that strict type comparisons should be used /// Flag indicating that strict type comparisons should be used
const bool strictTypes; bool strictTypes;
/// Cached regex objects for pattern constraint. Key - pattern. /// Cached regex objects for pattern constraint. Key - pattern.
std::unordered_map<std::string, std::regex> regexesCache; std::unordered_map<std::string, std::regex> regexesCache;
}; };
} // namespace valijson } // namespace valijson