- if (ch->type == SR_CHANNEL_LOGIC) {
- if (sr_scpi_send(sdi->conn, "D%d:WF?",
- ch->index + 1) != SR_OK)
- return SR_ERR;
- } else {
- if (sr_scpi_send(sdi->conn, "C%d:WF? ALL",
- ch->index + 1) != SR_OK)
- return SR_ERR;
- }
+ s = (ch->type == SR_CHANNEL_LOGIC) ? "D%d:WF?" : "C%d:WF? ALL";
+ if (sr_scpi_send(sdi->conn, s, ch->index + 1) != SR_OK)
+ return SR_ERR;