Skip to content

Commit

Permalink
Merge pull request CleverRaven#70498 from inogenous/performance-fewer…
Browse files Browse the repository at this point in the history
…-allocations-for-npc-doturn

Slightly fewer allocations in npc::process_turn
  • Loading branch information
akrieger authored Dec 29, 2023
2 parents 1b5557c + 8af0329 commit 394f235
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11729,11 +11729,11 @@ int Character::count_bionic_with_flag( const json_character_flag &flag ) const

bool Character::has_bodypart_with_flag( const json_character_flag &flag ) const
{
for( const bodypart_id &bp : get_all_body_parts() ) {
if( bp->has_flag( flag ) ) {
for( const std::pair<const bodypart_str_id, bodypart> &elem : get_body() ) {
if( elem.first->has_flag( flag ) ) {
return true;
}
if( get_part( bp )->has_conditional_flag( flag ) ) {
if( elem.second.has_conditional_flag( flag ) ) {
return true;
}
}
Expand Down

0 comments on commit 394f235

Please sign in to comment.