Permalink
Browse files

Eliminate 'loop variable creates a copy' warning

  • Loading branch information...
BrettDong committed Jan 4, 2019
1 parent 83b5b24 commit bf87ac0da653398fce604d4dcc5ccf5d20a8932f
Showing with 3 additions and 3 deletions.
  1. +2 −2 src/game.cpp
  2. +1 −1 src/mondeath.cpp
@@ -9471,7 +9471,7 @@ void game::butcher()
if( disassembles.size() > 1 ) {
int time_to_disassemble = 0;
int time_to_disassemble_all = 0;
for( const auto stack : disassembly_stacks ) {
for( const auto &stack : disassembly_stacks ) {
const item &it = items[ stack.first ];
const int time = recipe_dictionary::get_uncraft( it.typeId() ).time;
time_to_disassemble += time;
@@ -9485,7 +9485,7 @@ void game::butcher()
}
if( salvageables.size() > 1 ) {
int time_to_salvage = 0;
for( const auto stack : salvage_stacks ) {
for( const auto &stack : salvage_stacks ) {
const item &it = items[ stack.first ];
time_to_salvage += salvage_iuse->time_to_cut_up( it ) * stack.second;
}
@@ -180,7 +180,7 @@ void mdeath::splatter( monster &z )
if( pulverized && gibbable ) {
float overflow_ratio = overflow_damage / max_hp + 1;
int gib_distance = round( rng( 2, 4 ) );
for( const auto entry : *z.type->harvest ) {
for( const auto &entry : *z.type->harvest ) {
// only flesh and bones survive.
if( entry.type == "flesh" || entry.type == "bone" ) {
// the larger the overflow damage, the less you get

0 comments on commit bf87ac0

Please sign in to comment.