mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[Recurrence.c] avoid repeated calls to g_list_length
This commit is contained in:
parent
6bcd69026b
commit
31a0300abe
@ -685,14 +685,15 @@ gchar*
|
||||
recurrenceListToCompactString(GList *rs)
|
||||
{
|
||||
GString *buf = g_string_sized_new(16);
|
||||
gint rs_len = g_list_length (rs);
|
||||
|
||||
if (g_list_length(rs) == 0)
|
||||
if (rs_len == 0)
|
||||
{
|
||||
g_string_printf(buf, "%s", _("None"));
|
||||
goto rtn;
|
||||
}
|
||||
|
||||
if (g_list_length(rs) > 1)
|
||||
if (rs_len > 1)
|
||||
{
|
||||
if (recurrenceListIsWeeklyMultiple(rs))
|
||||
{
|
||||
@ -724,7 +725,7 @@ recurrenceListToCompactString(GList *rs)
|
||||
else
|
||||
{
|
||||
/* Translators: %d is the number of Recurrences in the list. */
|
||||
g_string_printf(buf, _("Unknown, %d-size list."), g_list_length(rs));
|
||||
g_string_printf(buf, _("Unknown, %d-size list."), rs_len);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user