From 69e0e30d062177ed479a2e97df7a69bdfb0453ed Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Fri, 16 Aug 2024 13:01:38 +0200 Subject: [PATCH] Improve const correctness in `generator` --- src/boost/locale/shared/generator.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/boost/locale/shared/generator.cpp b/src/boost/locale/shared/generator.cpp index baf424be..ddff3ba6 100644 --- a/src/boost/locale/shared/generator.cpp +++ b/src/boost/locale/shared/generator.cpp @@ -1,5 +1,6 @@ // // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) +// Copyright (c) 2024 Alexander Grund // // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt @@ -93,9 +94,7 @@ namespace boost { namespace locale { std::locale generator::generate(const std::string& id) const { - std::locale base = std::locale::classic(); - - return generate(base, id); + return generate(std::locale::classic(), id); } std::locale generator::generate(const std::locale& base, const std::string& id) const @@ -110,8 +109,8 @@ namespace boost { namespace locale { set_all_options(*backend, id); std::locale result = base; - category_t facets = d->cats; - char_facet_t chars = d->chars; + const category_t facets = d->cats; + const char_facet_t chars = d->chars; for(category_t facet = per_character_facet_first; facet <= per_character_facet_last; ++facet) { if(!(facets & facet))