summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--giscanner/sourcescanner.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/giscanner/sourcescanner.c b/giscanner/sourcescanner.c
index 830d21cd..90db2946 100644
--- a/giscanner/sourcescanner.c
+++ b/giscanner/sourcescanner.c
@@ -262,9 +262,11 @@ gi_source_scanner_set_macro_scan (GISourceScanner *scanner,
scanner->macro_scan = macro_scan;
}
-static gboolean
-already_has_current_file (GISourceScanner *scanner)
+void
+gi_source_scanner_add_symbol (GISourceScanner *scanner,
+ GISourceSymbol *symbol)
{
+ gboolean found_filename = FALSE;
GList *l;
GFile *current_file;
@@ -276,24 +278,15 @@ already_has_current_file (GISourceScanner *scanner)
GFile *file = g_file_new_for_path (l->data);
if (g_file_equal (file, current_file))
- {
+ {
+ found_filename = TRUE;
g_object_unref (file);
- return TRUE;
- }
-
+ break;
+ }
g_object_unref (file);
}
- g_object_unref (current_file);
-
- return FALSE;
-}
-
-void
-gi_source_scanner_add_symbol (GISourceScanner *scanner,
- GISourceSymbol *symbol)
-{
- if (scanner->macro_scan || already_has_current_file (scanner))
+ if (found_filename || scanner->macro_scan)
scanner->symbols = g_slist_prepend (scanner->symbols,
gi_source_symbol_ref (symbol));
g_assert (symbol->source_filename != NULL);
@@ -315,6 +308,8 @@ gi_source_scanner_add_symbol (GISourceScanner *scanner,
default:
break;
}
+
+ g_object_unref (current_file);
}
GSList *