summaryrefslogtreecommitdiff
path: root/gtkdoc-fixxref.in
diff options
context:
space:
mode:
authorStefan Sauer <ensonic@users.sf.net>2015-09-24 09:17:47 +0200
committerStefan Sauer <ensonic@users.sf.net>2015-09-24 09:19:07 +0200
commit0a456223c562f8fb7d09d5192baf2245d76dc62a (patch)
treee4dc81cda6b709736e7b967bbd61ff2e70a8afeb /gtkdoc-fixxref.in
parente0c07ee7ef6967e3de412bab5c0faa059c39def3 (diff)
downloadgtk-doc-0a456223c562f8fb7d09d5192baf2245d76dc62a.tar.gz
fixxref: add a dir-cache to avoid scanning multiple times
Scanning for index files multiple times is not only slow, but would also trigger warnings multiple times.
Diffstat (limited to 'gtkdoc-fixxref.in')
-rwxr-xr-xgtkdoc-fixxref.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/gtkdoc-fixxref.in b/gtkdoc-fixxref.in
index 2fb8d8f..3d9e8d0 100755
--- a/gtkdoc-fixxref.in
+++ b/gtkdoc-fixxref.in
@@ -63,6 +63,8 @@ my %NoLinks = (
'GInterface' => 1
);
+# Cache of dirs we already scanned for index files
+my %DirCache;
run() unless caller; # Run program unless loaded as a module
@@ -167,6 +169,8 @@ EOF
# check all extra dirs, but skip already scanned dirs or subdirs of those
foreach my $dir (@EXTRA_DIRS) {
my $vdir;
+
+ $dir =~ s#/$##;
@TRACE@("Scanning EXTRA_DIR directory: $dir");
# If the --extra-dir option is not relative and is not sharing the same
@@ -188,6 +192,11 @@ EOF
sub ScanIndices {
my ($scan_dir, $use_absolute_links) = @_;
+ if (exists $DirCache{$scan_dir}) {
+ return;
+ }
+ $DirCache{$scan_dir} = 1;
+
@TRACE@("Scanning source directory: $scan_dir absolute: $use_absolute_links");
# This array holds any subdirectories found.