[template-glib] expr: fix array insertion order
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [template-glib] expr: fix array insertion order
- Date: Thu, 5 May 2022 00:51:50 +0000 (UTC)
commit 9626da269dcf809373bb79889c77f5eee357de05
Author: Christian Hergert <chergert redhat com>
Date: Wed May 4 16:23:48 2022 -0700
expr: fix array insertion order
These should be reversed to preserve the expected order.
src/tmpl-expr-parser.y | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/tmpl-expr-parser.y b/src/tmpl-expr-parser.y
index e2321d7..9e1e0bc 100644
--- a/src/tmpl-expr-parser.y
+++ b/src/tmpl-expr-parser.y
@@ -96,7 +96,7 @@ add_to_list (TmplExpr *stmt,
}
g_assert (list->any.type == TMPL_EXPR_STMT_LIST);
- g_ptr_array_add (list->stmt_list.stmts, stmt);
+ g_ptr_array_insert (list->stmt_list.stmts, 0, stmt);
return list;
}
@@ -259,7 +259,7 @@ symlist: NAME {
}
| NAME ',' symlist {
$$ = $3;
- g_ptr_array_add ($$, $1);
+ g_ptr_array_insert ($$, 0, $1);
}
;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]