mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Move declaration into loop
This commit is contained in:
parent
ddc09940b1
commit
dbda7bfbed
1 changed files with 2 additions and 4 deletions
|
@ -538,8 +538,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
|
||||||
if (!buf[0]) {
|
if (!buf[0]) {
|
||||||
// Send list of configured bar IDs
|
// Send list of configured bar IDs
|
||||||
json_object *bars = json_object_new_array();
|
json_object *bars = json_object_new_array();
|
||||||
int i;
|
for (int i = 0; i < config->bars->length; ++i) {
|
||||||
for (i = 0; i < config->bars->length; ++i) {
|
|
||||||
struct bar_config *bar = config->bars->items[i];
|
struct bar_config *bar = config->bars->items[i];
|
||||||
json_object_array_add(bars, json_object_new_string(bar->id));
|
json_object_array_add(bars, json_object_new_string(bar->id));
|
||||||
}
|
}
|
||||||
|
@ -549,8 +548,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
|
||||||
} else {
|
} else {
|
||||||
// Send particular bar's details
|
// Send particular bar's details
|
||||||
struct bar_config *bar = NULL;
|
struct bar_config *bar = NULL;
|
||||||
int i;
|
for (int i = 0; i < config->bars->length; ++i) {
|
||||||
for (i = 0; i < config->bars->length; ++i) {
|
|
||||||
bar = config->bars->items[i];
|
bar = config->bars->items[i];
|
||||||
if (strcmp(buf, bar->id) == 0) {
|
if (strcmp(buf, bar->id) == 0) {
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue