Skip to content

Commit

Permalink
more clang
Browse files Browse the repository at this point in the history
  • Loading branch information
GuardianDll committed Nov 12, 2024
1 parent 4d934e2 commit 14bf2c4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/magic_enchantment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -686,13 +686,13 @@ void enchant_cache::serialize( JsonOut &jsout ) const

jsout.member( "special_vision" );
jsout.start_array();
for( const special_vision struc : special_vision_vector ) {
for( const special_vision &struc : special_vision_vector ) {
jsout.start_object();
// jsout.member( "condition", struc.condition );
jsout.member( "distance", struc.range );
jsout.member( "descriptions" );
jsout.start_array();
for( const special_vision_descriptions struc_desc : struc.special_vision_descriptions_vector ) {
for( const special_vision_descriptions &struc_desc : struc.special_vision_descriptions_vector ) {
jsout.start_object();
jsout.member( "id", struc_desc.id );
// jsout.member( "text_condition", struc_desc.condition );
Expand Down Expand Up @@ -1047,7 +1047,7 @@ bool enchantment::get_vision_distance( const Character &guy, const Creature &cri
const double distance = rl_dist_exact( guy.pos(), critter.pos() );
const_dialogue d( get_const_talker_for( guy ), get_const_talker_for( critter ) );

for( const special_vision struc : special_vision_vector ) {
for( const special_vision &struc : special_vision_vector ) {
if( struc.range.evaluate( d ) >= distance && struc.condition( d ) ) {
return true;
}
Expand All @@ -1063,7 +1063,7 @@ std::string enchantment::get_vision_description( const Character &guy,
const_dialogue d( get_const_talker_for( guy ), get_const_talker_for( critter ) );
const double distance = rl_dist_exact( guy.pos(), critter.pos() );

for( const special_vision struc : special_vision_vector ) {
for( const special_vision &struc : special_vision_vector ) {
if( struc.range.evaluate( d ) >= distance && struc.condition( d ) ) {
for( enchantment::special_vision_descriptions desc : struc.special_vision_descriptions_vector ) {

Check failure on line 1068 in src/magic_enchantment.cpp

View workflow job for this annotation

GitHub Actions / build (src)

loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy,-warnings-as-errors]
if( desc.condition( d ) ) {
Expand All @@ -1083,7 +1083,7 @@ std::string enchantment::get_vision_tile( const Character &guy, const Creature &
const_dialogue d( get_const_talker_for( guy ), get_const_talker_for( critter ) );
const double distance = rl_dist_exact( guy.pos(), critter.pos() );

for( const special_vision struc : special_vision_vector ) {
for( const special_vision &struc : special_vision_vector ) {
if( struc.range.evaluate( d ) >= distance && struc.condition( d ) ) {
for( enchantment::special_vision_descriptions desc : struc.special_vision_descriptions_vector ) {

Check failure on line 1088 in src/magic_enchantment.cpp

View workflow job for this annotation

GitHub Actions / build (src)

loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy,-warnings-as-errors]
if( desc.condition( d ) ) {
Expand Down Expand Up @@ -1142,7 +1142,7 @@ bool enchant_cache::get_vision_distance( const Character &guy, const Creature &c
const_dialogue d( get_const_talker_for( guy ), get_const_talker_for( critter ) );
const double distance = rl_dist_exact( guy.pos(), critter.pos() );

for( const special_vision struc : special_vision_vector ) {
for( const special_vision &struc : special_vision_vector ) {
if( struc.range >= distance && struc.condition( d ) ) {
return true;
}
Expand All @@ -1157,7 +1157,7 @@ std::string enchant_cache::get_vision_description( const Character &guy,
const_dialogue d( get_const_talker_for( guy ), get_const_talker_for( critter ) );
const double distance = rl_dist_exact( guy.pos(), critter.pos() );

for( const special_vision struc : special_vision_vector ) {
for( const special_vision &struc : special_vision_vector ) {
if( struc.range >= distance && struc.condition( d ) ) {
for( enchantment::special_vision_descriptions desc : struc.special_vision_descriptions_vector ) {

Check failure on line 1162 in src/magic_enchantment.cpp

View workflow job for this annotation

GitHub Actions / build (src)

loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy,-warnings-as-errors]
if( desc.condition( d ) ) {
Expand All @@ -1176,7 +1176,7 @@ std::string enchant_cache::get_vision_tile( const Character &guy, const Creature
const_dialogue d( get_const_talker_for( guy ), get_const_talker_for( critter ) );
const double distance = rl_dist_exact( guy.pos(), critter.pos() );

for( const special_vision struc : special_vision_vector ) {
for( const special_vision &struc : special_vision_vector ) {
if( struc.range >= distance && struc.condition( d ) ) {
for( enchantment::special_vision_descriptions desc : struc.special_vision_descriptions_vector ) {

Check failure on line 1181 in src/magic_enchantment.cpp

View workflow job for this annotation

GitHub Actions / build (src)

loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy,-warnings-as-errors]
if( desc.condition( d ) ) {
Expand Down

0 comments on commit 14bf2c4

Please sign in to comment.