mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Get rid of redundant RPC params.size() checks
No change in behavior.
This commit is contained in:
parent
c2704ec98a
commit
e666efcdba
6 changed files with 33 additions and 33 deletions
|
|
@ -552,7 +552,7 @@ UniValue getmemoryinfo(const JSONRPCRequest& request)
|
|||
+ HelpExampleRpc("getmemoryinfo", "")
|
||||
);
|
||||
|
||||
std::string mode = (request.params.size() < 1 || request.params[0].isNull()) ? "stats" : request.params[0].get_str();
|
||||
std::string mode = request.params[0].isNull() ? "stats" : request.params[0].get_str();
|
||||
if (mode == "stats") {
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
obj.push_back(Pair("locked", RPCLockedMemoryInfo()));
|
||||
|
|
@ -603,11 +603,11 @@ UniValue logging(const JSONRPCRequest& request)
|
|||
}
|
||||
|
||||
uint32_t originalLogCategories = logCategories;
|
||||
if (request.params.size() > 0 && request.params[0].isArray()) {
|
||||
if (request.params[0].isArray()) {
|
||||
logCategories |= getCategoryMask(request.params[0]);
|
||||
}
|
||||
|
||||
if (request.params.size() > 1 && request.params[1].isArray()) {
|
||||
if (request.params[1].isArray()) {
|
||||
logCategories &= ~getCategoryMask(request.params[1]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue