Simplify some code with utils::join().
This commit is contained in:
parent
8733b8f144
commit
4efe45f90f
1 changed files with 6 additions and 16 deletions
|
@ -228,22 +228,12 @@ void carryover::transfer_all_recalls_to(config& side_cfg){
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string carryover::get_recruits(bool erase){
|
std::string carryover::get_recruits(bool erase){
|
||||||
std::stringstream can_recruit;
|
// Join the previous recruits into a string.
|
||||||
for(std::set<std::string>::iterator i = previous_recruits_.begin()
|
std::string can_recruit_str = utils::join(previous_recruits_);
|
||||||
; i != previous_recruits_.end()
|
if ( erase )
|
||||||
; ){
|
// Clear the previous recruits.
|
||||||
can_recruit << *i << ",";
|
previous_recruits_.clear();
|
||||||
if(erase){
|
|
||||||
previous_recruits_.erase(i++);
|
|
||||||
} else {
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
std::string can_recruit_str = can_recruit.str();
|
|
||||||
// Remove the trailing comma
|
|
||||||
if(can_recruit_str.empty() == false) {
|
|
||||||
can_recruit_str.resize(can_recruit_str.size()-1);
|
|
||||||
}
|
|
||||||
return can_recruit_str;
|
return can_recruit_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue