From: Uwe Hermann Date: Thu, 29 Mar 2018 06:45:25 +0000 (+0200) Subject: rdtech-dps: User ternary operator. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=66d2cc3a278b6b8146e0772deb7461bebdffdd2e;p=libsigrok.git rdtech-dps: User ternary operator. --- diff --git a/src/hardware/rdtech-dps/api.c b/src/hardware/rdtech-dps/api.c index f719e6c7..e321ce36 100644 --- a/src/hardware/rdtech-dps/api.c +++ b/src/hardware/rdtech-dps/api.c @@ -197,10 +197,7 @@ static int config_get(uint32_t key, GVariant **data, case SR_CONF_REGULATION: if ((ret = rdtech_dps_get_reg(modbus, REG_CV_CC, &ivalue)) != SR_OK) break; - if (ivalue == MODE_CC) - *data = g_variant_new_string("CC"); - else - *data = g_variant_new_string("CV"); + *data = g_variant_new_string((ivalue == MODE_CC) ? "CC" : "CV"); break; case SR_CONF_VOLTAGE: if ((ret = rdtech_dps_get_reg(modbus, REG_UOUT, &ivalue)) == SR_OK)