From 88d96bc41ff638bdc767e30bf6ccbbd530258420 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Thu, 20 Dec 2018 13:02:45 -0500 Subject: Combine output_by_name and output_by_identifier This combines `output_by_name` and `output_by_identifier` into a single function called `output_by_name_or_id`. This allows for output identifiers to be used in all commands, simplifies the logic of the callers, and is more efficient since worst case is a single pass through the output list. --- sway/commands/output/transform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sway/commands/output/transform.c') diff --git a/sway/commands/output/transform.c b/sway/commands/output/transform.c index c1555323..ca6f73a4 100644 --- a/sway/commands/output/transform.c +++ b/sway/commands/output/transform.c @@ -45,7 +45,7 @@ struct cmd_results *output_cmd_transform(int argc, char **argv) { return cmd_results_new(CMD_INVALID, "output", "Cannot apply relative transform to all outputs."); } - struct sway_output *s_output = output_by_name(output->name); + struct sway_output *s_output = output_by_name_or_id(output->name); if (s_output == NULL) { return cmd_results_new(CMD_INVALID, "output", "Cannot apply relative transform to unknown output %s", output->name); -- cgit v1.2.3-54-g00ecf