From 993df0fd289d4426c633fd6e6d12bffe6061599d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 11 Aug 2015 21:54:29 +0200 Subject: command/{Queue,Other}: eliminate local "bool" variable --- src/command/OtherCommands.cxx | 5 +---- src/command/QueueCommands.cxx | 4 +--- src/command/StickerCommands.cxx | 10 ++++------ 3 files changed, 6 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/command/OtherCommands.cxx b/src/command/OtherCommands.cxx index 9ca7567b9..6ef9b0bd7 100644 --- a/src/command/OtherCommands.cxx +++ b/src/command/OtherCommands.cxx @@ -308,8 +308,6 @@ CommandResult handle_setvol(Client &client, ConstBuffer args) { unsigned level; - bool success; - if (!check_unsigned(client, &level, args.front())) return CommandResult::ERROR; @@ -318,8 +316,7 @@ handle_setvol(Client &client, ConstBuffer args) return CommandResult::ERROR; } - success = volume_level_change(client.partition.outputs, level); - if (!success) { + if (!volume_level_change(client.partition.outputs, level)) { command_error(client, ACK_ERROR_SYSTEM, "problems setting volume"); return CommandResult::ERROR; diff --git a/src/command/QueueCommands.cxx b/src/command/QueueCommands.cxx index d461170fd..561ef1027 100644 --- a/src/command/QueueCommands.cxx +++ b/src/command/QueueCommands.cxx @@ -249,13 +249,11 @@ CommandResult handle_playlistinfo(Client &client, ConstBuffer args) { unsigned start = 0, end = std::numeric_limits::max(); - bool ret; if (args.size == 1 && !check_range(client, &start, &end, args.front())) return CommandResult::ERROR; - ret = playlist_print_info(client, client.playlist, start, end); - if (!ret) + if (!playlist_print_info(client, client.playlist, start, end)) return print_playlist_result(client, PlaylistResult::BAD_RANGE); diff --git a/src/command/StickerCommands.cxx b/src/command/StickerCommands.cxx index 8979d53a4..9dda3c65d 100644 --- a/src/command/StickerCommands.cxx +++ b/src/command/StickerCommands.cxx @@ -166,17 +166,15 @@ handle_sticker_song(Client &client, ConstBuffer args) } } - bool success; struct sticker_song_find_data data = { client, args[3], }; - success = sticker_song_find(*db, base_uri, data.name, - op, value, - sticker_song_find_print_cb, &data, - error); - if (!success) { + if (!sticker_song_find(*db, base_uri, data.name, + op, value, + sticker_song_find_print_cb, &data, + error)) { if (error.IsDefined()) return print_error(client, error); -- cgit v1.2.3