From fd5c1e542eff7358447ddda6d43f6a90b3045742 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 10 Apr 2019 07:53:03 +1000 Subject: Backport: Use noexcept in CaseConvert as well as std::string_view::copy. Backport of changeset 7414:599d698f70bf, but without std::string_view::copy. --- src/CaseConvert.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/CaseConvert.cxx b/src/CaseConvert.cxx index d57875996..c1cfd38e2 100644 --- a/src/CaseConvert.cxx +++ b/src/CaseConvert.cxx @@ -569,7 +569,7 @@ class CaseConverter : public ICaseConverter { enum { maxConversionLength=6 }; struct ConversionString { char conversion[maxConversionLength+1]; - ConversionString() : conversion{} { + ConversionString() noexcept : conversion{} { } }; // Conversions are initially store in a vector of structs but then decomposed into @@ -591,10 +591,10 @@ class CaseConverter : public ICaseConverter { std::vector conversions; public: - CaseConverter() { + CaseConverter() noexcept { } virtual ~CaseConverter() = default; - bool Initialised() const { + bool Initialised() const noexcept { return !characters.empty(); } void Add(int character, const char *conversion) { @@ -771,7 +771,7 @@ void SetupConversions(enum CaseConversion conversion) { } } -CaseConverter *ConverterForConversion(enum CaseConversion conversion) { +CaseConverter *ConverterForConversion(enum CaseConversion conversion) noexcept { switch (conversion) { case CaseConversionFold: return &caseConvFold; -- cgit v1.2.3