diff options
author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2018-12-09 00:00:00 +0000 |
---|---|---|
committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2018-12-09 14:44:16 +0100 |
commit | 51f7cb11a4f0a247381be9f69d432cc182d8ffda (patch) | |
tree | 5030ee6885c9b47647c795aca1baf0ca32a58dab /giscanner/scannerlexer.l | |
parent | f6f32926106587b7969d53d86cf6412b26a0625e (diff) | |
download | gobject-introspection-51f7cb11a4f0a247381be9f69d432cc182d8ffda.tar.gz |
Replace linked lists with arrays in source scanner
Reduce total number of memory allocations and increase data locality.
Diffstat (limited to 'giscanner/scannerlexer.l')
-rw-r--r-- | giscanner/scannerlexer.l | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/giscanner/scannerlexer.l b/giscanner/scannerlexer.l index 42e79d42..d3a6017e 100644 --- a/giscanner/scannerlexer.l +++ b/giscanner/scannerlexer.l @@ -515,7 +515,7 @@ print_error (GISourceScanner *scanner) if (yytext[0]) { char *filename = g_file_get_parse_name (scanner->current_file); gchar *error = g_strdup_printf ("%s:%d: unexpected character `%c'", filename, lineno, yytext[0]); - scanner->errors = g_slist_prepend (scanner->errors, error); + g_ptr_array_add (scanner->errors, error); g_free (filename); } } |