From d0fb1f30bc8d6e8b17b3b514d62fb11fea0834b9 Mon Sep 17 00:00:00 2001 From: Binrui Dong Date: Wed, 21 Jul 2021 16:28:53 +0800 Subject: [PATCH] Fix recent clang tidy warnings (#50084) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix clang-tidy warning on string concatenation in learn_spell_actor::info() * Fix clang-tidy warning on parameter name mismatch in Character::estimate_effect_dur() Co-authored-by: eltank <8000047+eltank@users.noreply.github.com> Co-authored-by: Kevin Granade Co-authored-by: Jianxiang Wang (王健翔) Co-authored-by: eltank <8000047+eltank@users.noreply.github.com> --- src/character.h | 2 +- src/iuse_actor.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/character.h b/src/character.h index 69aeae553cf7f..c4e2742b15f2d 100644 --- a/src/character.h +++ b/src/character.h @@ -2753,7 +2753,7 @@ class Character : public Creature, public visitable @param minimum_error Maximum error when skill is >= threshold */ time_duration estimate_effect_dur( const skill_id &relevant_skill, const efftype_id &effect, const time_duration &error_magnitude, - const time_duration &mimimum_error, int threshold, const Creature &target ) const; + const time_duration &minimum_error, int threshold, const Creature &target ) const; // inherited from visitable bool has_quality( const quality_id &qual, int level = 1, int qty = 1 ) const override; diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index a511e0fec3e9e..a3f7161126340 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -2183,13 +2183,13 @@ void learn_spell_actor::info( const item &, std::vector &dump ) const const spell sp = pc.magic->get_spell( sp_id ); spell_text += ": " + string_format( _( "Level %u" ), sp.get_level() ); if( sp.is_max_level() ) { - spell_text = "" + spell_text + _( " (Max)" ) + ""; + spell_text = string_format( _( "%1$s (Max)" ), spell_text ); } else { - spell_text = "" + spell_text + ""; + spell_text = string_format( "%s", spell_text ); } } else { if( pc.magic->can_learn_spell( pc, sp_id ) ) { - spell_text = "" + spell_text + ""; + spell_text = string_format( "%s", spell_text ); } } dump.emplace_back( "SPELL", spell_text );