Skip to content

Commit

Permalink
Merge commit 'bb52512' into ppa
Browse files Browse the repository at this point in the history
  • Loading branch information
o01eg committed May 14, 2024
2 parents 97f2765 + bb52512 commit 028649a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Empire/EmpireManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ boost::container::flat_set<int> EmpireManager::GetEmpireIDsWithDiplomaticStatusW
retval.reserve(statuses.size()); // probably an overestimate

// find ids of empires with the specified diplomatic status with the specified empire
for (auto const [emp1, emp2] : statuses
for (auto const &[emp1, emp2] : statuses
| range_filter([diplo_status](const auto& ids_status) noexcept { return ids_status.second == diplo_status; })
| range_keys)
{
Expand Down
2 changes: 1 addition & 1 deletion GG/src/Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1863,7 +1863,7 @@ void Font::Init(FT_Face& face)
Y y = Y0;
X max_x = X0;
Y max_y = Y0;
for (const auto [low, high] : range_vec) {
for (const auto &[low, high] : range_vec) {
for (uint32_t c = low; c < high; ++c) {
// skip already-existing glphys
if (std::any_of(temp_glyph_data.begin(), temp_glyph_data.end(),
Expand Down
2 changes: 1 addition & 1 deletion server/ServerApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3958,7 +3958,7 @@ namespace {
continue;

// every (blockading fleet) X (blockaded fleet) X (recipient empire) generates a separate sitrep
for (const auto [blockading_fleet_id, blockading_empire_id] : blockading_fleets_and_empire_ids) {
for (const auto &[blockading_fleet_id, blockading_empire_id] : blockading_fleets_and_empire_ids) {
if (context.ContextVis(blockading_fleet_id, recipient_empire_id) >= Visibility::VIS_PARTIAL_VISIBILITY) {
// if the blockading fleet is also visible, include that info
recipient_empire->AddSitRepEntry(
Expand Down
5 changes: 2 additions & 3 deletions universe/ValueRefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ namespace {
const UniverseObject* obj = GetRefObject(ref_type, context);

if (!obj) {
std::string_view type_string{to_string(ref_type)};

static constexpr auto ref_strings = [](auto it, const auto last) {
std::string retval;
retval.reserve(100); // guesstimate
Expand All @@ -129,8 +127,9 @@ namespace {
return retval;
};


static constexpr auto name_or_0 = [](const UniverseObject* obj) noexcept -> std::string_view
{ return obj ? obj->Name() : "0"; };
{ return obj ? std::string_view{obj->Name()} : std::string_view{"0"}; };

ErrorLogger() << "FollowReference : top level object (" << to_string(ref_type)
<< ") not defined in scripting context. strings: " << ref_strings(first, last)
Expand Down
2 changes: 1 addition & 1 deletion util/SerializeEmpire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ void serialize(Archive& ar, EmpireManager& em, unsigned int const version)
// erase invalid empire diplomatic statuses
std::vector<std::pair<int, int>> to_erase;
to_erase.reserve(em.m_empire_diplomatic_statuses.size());
for (const auto [e1, e2] : em.m_empire_diplomatic_statuses | range_keys) {
for (const auto &[e1, e2] : em.m_empire_diplomatic_statuses | range_keys) {
if (!em.m_empire_map.contains(e1) || !em.m_empire_map.contains(e2)) {
to_erase.emplace_back(e1, e2);
ErrorLogger() << "Erased invalid diplomatic status between empires " << e1 << " and " << e2;
Expand Down

0 comments on commit 028649a

Please sign in to comment.