summaryrefslogtreecommitdiff
path: root/giscanner/scannerlexer.l
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2018-12-09 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2018-12-09 14:44:16 +0100
commit51f7cb11a4f0a247381be9f69d432cc182d8ffda (patch)
tree5030ee6885c9b47647c795aca1baf0ca32a58dab /giscanner/scannerlexer.l
parentf6f32926106587b7969d53d86cf6412b26a0625e (diff)
downloadgobject-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.l2
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);
}
}