diff options
author | Max Kellermann <max@duempel.org> | 2014-02-28 07:11:45 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-28 07:12:04 +0100 |
commit | 4c27898ce7f72c75405c293e3b8e06db4d2438eb (patch) | |
tree | 9160b17b2b34889af99f73077ec5682784f1c92c /src/command | |
parent | e9a85aa4e4d0634548b5c97461beb27ae5559338 (diff) | |
download | mpd-4c27898ce7f72c75405c293e3b8e06db4d2438eb.tar.gz mpd-4c27898ce7f72c75405c293e3b8e06db4d2438eb.tar.xz mpd-4c27898ce7f72c75405c293e3b8e06db4d2438eb.zip |
{Other,Database}Commands: contract declaration and assignment
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/DatabaseCommands.cxx | 9 | ||||
-rw-r--r-- | src/command/OtherCommands.cxx | 9 |
2 files changed, 6 insertions, 12 deletions
diff --git a/src/command/DatabaseCommands.cxx b/src/command/DatabaseCommands.cxx index 89fe2e050..9d00698c6 100644 --- a/src/command/DatabaseCommands.cxx +++ b/src/command/DatabaseCommands.cxx @@ -34,13 +34,10 @@ CommandResult handle_lsinfo2(Client &client, int argc, char *argv[]) { - const char *uri; - - if (argc == 2) - uri = argv[1]; - else + const char *const uri = argc == 2 + ? argv[1] /* default is root directory */ - uri = ""; + : ""; const DatabaseSelection selection(uri, false); diff --git a/src/command/OtherCommands.cxx b/src/command/OtherCommands.cxx index b3564040c..6415e84df 100644 --- a/src/command/OtherCommands.cxx +++ b/src/command/OtherCommands.cxx @@ -121,13 +121,10 @@ static constexpr tag_handler print_tag_handler = { CommandResult handle_lsinfo(Client &client, int argc, char *argv[]) { - const char *uri; - - if (argc == 2) - uri = argv[1]; - else + const char *const uri = argc == 2 + ? argv[1] /* default is root directory */ - uri = ""; + : ""; if (memcmp(uri, "file:///", 8) == 0) { /* print information about an arbitrary local file */ |