Skip to content

Commit

Permalink
refactor: don't mutate string
Browse files Browse the repository at this point in the history
  • Loading branch information
scarf005 committed Dec 5, 2024
1 parent d3f0485 commit 4fe00c5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3024,13 +3024,13 @@ void item::book_info( std::vector<iteminfo> &info, const iteminfo_query *parts,
const SkillLevel &skill = you.get_skill_level_object( book.skill );
if( parts->test( iteminfo_parts::BOOK_SKILLRANGE_MAX ) ) {
const std::string skill_name = book.skill->name();
std::string fmt = string_format( _( "Can bring <info>%s skill to</info> "
"<num>." ), skill_name );
const std::string fmt = string_format( _( "Can bring <info>%s skill to</info> "
"<num>." ), skill_name );
info.emplace_back( "BOOK", "", skill.can_train() ? fmt : colorize( fmt, c_brown ),
iteminfo::no_flags, book.level );
fmt = string_format( _( "Your current <stat>%s skill</stat> is <num>." ),
skill_name );
info.emplace_back( "BOOK", "", fmt, iteminfo::no_flags, skill.level() );
info.emplace_back( "BOOK", "",
string_format( _( "Your current <stat>%s skill</stat> is <num>." ), skill_name ),
iteminfo::no_flags, skill.level() );
}

if( book.req != 0 && parts->test( iteminfo_parts::BOOK_SKILLRANGE_MIN ) ) {
Expand Down

0 comments on commit 4fe00c5

Please sign in to comment.