Replace strcmp() with string comparison operator
This isn't C.
This commit is contained in:
parent
f37175ee2d
commit
08979a6736
2 changed files with 3 additions and 2 deletions
|
@ -127,8 +127,9 @@ void unit_create::pre_show(window& window)
|
|||
row_data.emplace("race", column);
|
||||
|
||||
column["label"] = units_.back()->type_name();
|
||||
if(strcmp(units_.back()->type_name().c_str(), units_.back()->id().c_str()))
|
||||
if(units_.back()->type_name().str() != units_.back()->id()) {
|
||||
column["label"] += " (" + units_.back()->id() + ")";
|
||||
}
|
||||
row_data.emplace("unit_type", column);
|
||||
|
||||
list.add_row(row_data);
|
||||
|
|
|
@ -951,7 +951,7 @@ std::vector<topic> generate_unit_topics(const bool sort_generated, const std::st
|
|||
continue;
|
||||
|
||||
const std::string debug_suffix = (game_config::debug ? " (" + type.id() + ")" : "");
|
||||
const std::string type_name = type.type_name() + (!strcmp(type.id().c_str(), type.type_name().c_str()) ? "" : debug_suffix);
|
||||
const std::string type_name = type.type_name() + (type.id() == type.type_name().str() ? "" : debug_suffix);
|
||||
const std::string real_prefix = type.show_variations_in_help() ? ".." : "";
|
||||
const std::string ref_id = hidden_symbol(type.hide_help()) + real_prefix + unit_prefix + type.id();
|
||||
topic unit_topic(type_name, ref_id, "");
|
||||
|
|
Loading…
Add table
Reference in a new issue