Skip to content

Commit 69e0e30

Browse files
committed
Improve const correctness in generator
1 parent 397f013 commit 69e0e30

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/boost/locale/shared/generator.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//
22
// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
3+
// Copyright (c) 2024 Alexander Grund
34
//
45
// Distributed under the Boost Software License, Version 1.0.
56
// https://www.boost.org/LICENSE_1_0.txt
@@ -93,9 +94,7 @@ namespace boost { namespace locale {
9394

9495
std::locale generator::generate(const std::string& id) const
9596
{
96-
std::locale base = std::locale::classic();
97-
98-
return generate(base, id);
97+
return generate(std::locale::classic(), id);
9998
}
10099

101100
std::locale generator::generate(const std::locale& base, const std::string& id) const
@@ -110,8 +109,8 @@ namespace boost { namespace locale {
110109
set_all_options(*backend, id);
111110

112111
std::locale result = base;
113-
category_t facets = d->cats;
114-
char_facet_t chars = d->chars;
112+
const category_t facets = d->cats;
113+
const char_facet_t chars = d->chars;
115114

116115
for(category_t facet = per_character_facet_first; facet <= per_character_facet_last; ++facet) {
117116
if(!(facets & facet))

0 commit comments

Comments
 (0)