Skip to content

Commit 470fbc7

Browse files
qarkaicaclark
authored andcommitted
Reduce text_char_to_num() parameters number
1 parent 1fdc9ff commit 470fbc7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/layout-config.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,10 @@ void layout_config_number_cb(GtkTreeViewColumn *, GtkCellRenderer *cell,
195195
NULL);
196196
}
197197

198-
gint text_char_to_num(const gchar *text, gint n)
198+
gint text_char_to_num(gchar c)
199199
{
200-
if (text[n] == '3') return 2;
201-
if (text[n] == '2') return 1;
200+
if (c == '3') return 2;
201+
if (c == '2') return 1;
202202
return 0;
203203
}
204204

@@ -212,9 +212,9 @@ void layout_config_order_from_text(const gchar *text, gint &a, gint &b, gint &c)
212212
}
213213
else
214214
{
215-
a = text_char_to_num(text, 0);
216-
b = text_char_to_num(text, 1);
217-
c = text_char_to_num(text, 2);
215+
a = text_char_to_num(text[0]);
216+
b = text_char_to_num(text[1]);
217+
c = text_char_to_num(text[2]);
218218
}
219219
}
220220

0 commit comments

Comments
 (0)