mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-19 06:08:55 +00:00
Use empty() instead of comparing size() with 0.
Issue found by cppcheck.
This commit is contained in:
parent
c5ec758142
commit
5c3d0c1901
@ -284,7 +284,7 @@ const std::vector<game_config::server_info>& server_list()
|
||||
static std::vector<game_config::server_info> pref_servers;
|
||||
if(pref_servers.empty()) {
|
||||
std::vector<game_config::server_info> &game_servers = game_config::server_list;
|
||||
VALIDATE(game_servers.size() > 0, _("No server has been defined."));
|
||||
VALIDATE(!game_servers.empty(), _("No server has been defined."));
|
||||
pref_servers.insert(pref_servers.begin(), game_servers.begin(), game_servers.end());
|
||||
foreach (const config &server, get_prefs()->child_range("server")) {
|
||||
game_config::server_info sinf;
|
||||
|
@ -1210,7 +1210,7 @@ bool show_theme_dialog(display& disp)
|
||||
{
|
||||
int action = 0;
|
||||
std::vector<std::string> options = disp.get_theme().get_known_themes();
|
||||
if(options.size()){
|
||||
if(!options.empty()){
|
||||
std::string current_theme=_("Saved Theme Preference: ")+preferences::theme();
|
||||
action = gui::show_dialog(disp,NULL,"",current_theme,gui::OK_CANCEL,&options);
|
||||
if(action >= 0){
|
||||
|
Loading…
x
Reference in New Issue
Block a user