Skip to content

Commit

Permalink
Improve const correctness in generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Dec 1, 2024
1 parent 397f013 commit 69e0e30
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/boost/locale/shared/generator.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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))
Expand Down

0 comments on commit 69e0e30

Please sign in to comment.