Skip to content

Commit

Permalink
Used constant references in function parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhilkinSerg committed May 31, 2019
1 parent 62d752b commit 1807ff3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/basecamp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ void basecamp::add_resource( const itype_id &camp_resource )
fuel_types.insert( bcp_r.ammo_id );
}

void basecamp::update_resources( const std::string bldg )
void basecamp::update_resources( const std::string &bldg )
{
if( !recipe_id( bldg ).is_valid() ) {
return;
Expand All @@ -309,7 +309,7 @@ void basecamp::update_resources( const std::string bldg )
}
}

void basecamp::update_provides( const std::string bldg, expansion_data &e_data )
void basecamp::update_provides( const std::string &bldg, expansion_data &e_data )
{
if( !recipe_id( bldg ).is_valid() ) {
return;
Expand Down Expand Up @@ -429,7 +429,7 @@ void basecamp::set_name( const std::string &new_name )
* we could put this logic in map::use_charges() the way the vehicle code does, but I think
* that's sloppy
*/
std::list<item> basecamp::use_charges( const itype_id fake_id, int &quantity )
std::list<item> basecamp::use_charges( const itype_id &fake_id, int &quantity )
{
std::list<item> ret;
if( quantity <= 0 ) {
Expand Down
6 changes: 3 additions & 3 deletions src/basecamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ class basecamp
// upgrade levels
bool has_provides( const std::string &req, const expansion_data &e_data, int level = 0 ) const;
bool has_provides( const std::string &req, const std::string &dir = "all", int level = 0 ) const;
void update_resources( const std::string bldg );
void update_provides( const std::string bldg, expansion_data &e_data );
void update_resources( const std::string &bldg );
void update_provides( const std::string &bldg, expansion_data &e_data );


bool can_expand();
Expand Down Expand Up @@ -134,7 +134,7 @@ class basecamp
int recipe_batch_max( const recipe &making ) const;
void form_crafting_inventory( const bool by_radio = false );
void form_crafting_inventory( map &target_map );
std::list<item> use_charges( const itype_id fake_id, int &quantity );
std::list<item> use_charges( const itype_id &fake_id, int &quantity );
void consume_components( const recipe &making, int batch_size, bool by_radio = false );
void consume_components( map &target_map, const recipe &making, int batch_size,
bool by_radio = false );
Expand Down
4 changes: 2 additions & 2 deletions src/faction_camp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ int om_harvest_ter_break( npc &comp, const tripoint &omt_tgt, const ter_id &t, i
/// @ref take, whether you take the item or count it
mass_volume om_harvest_itm( npc_ptr comp, const tripoint &omt_tgt, int chance = 100,
bool take = true );
void apply_camp_ownership( const tripoint camp_pos, int radius );
void apply_camp_ownership( const tripoint &camp_pos, int radius );
/*
* Counts or cuts trees into trunks and trunks into logs
* @param omt_tgt the targeted OM tile
Expand Down Expand Up @@ -3564,7 +3564,7 @@ void basecamp::place_results( item result, bool by_radio )
}
}

void apply_camp_ownership( const tripoint camp_pos, int radius )
void apply_camp_ownership( const tripoint &camp_pos, int radius )
{
for( const tripoint &p : g->m.points_in_rectangle( tripoint( camp_pos.x - radius,
camp_pos.y - radius, camp_pos.z ), tripoint( camp_pos.x + radius, camp_pos.y + radius,
Expand Down
2 changes: 1 addition & 1 deletion src/map_extras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ static void mx_clay_deposit( map &m, const tripoint &abs_sub )
}
}

static void dead_vegetation_parser( map &m, const tripoint loc )
static void dead_vegetation_parser( map &m, const tripoint &loc )
{
// furniture plants die to withered plants
const furn_t &fid = m.furn( loc ).obj();
Expand Down

0 comments on commit 1807ff3

Please sign in to comment.