Commit 1dd1e48e authored by Joerg Bornemann's avatar Joerg Bornemann
Browse files

Simplify tests whether to run header checks


Turn lists into hashes and check for existence of an element using key
lookup. This leads to simpler testing code and is potentially faster.

Change-Id: Ibbf4f03ec64d6c295cc5e1664dfa73cd0ce8c272
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Showing with 6 additions and 6 deletions
...@@ -81,6 +81,8 @@ our @qpa_headers = (); ...@@ -81,6 +81,8 @@ our @qpa_headers = ();
# will be derived from sync.profile # will be derived from sync.profile
our %reverse_classnames = (); our %reverse_classnames = ();
my %ignore_for_include_check = ();
my %ignore_for_qt_begin_namespace_check = ();
# global variables (modified by options) # global variables (modified by options)
my $isunix = 0; my $isunix = 0;
...@@ -801,6 +803,8 @@ loadSyncProfile(\$basedir, \$out_basedir); ...@@ -801,6 +803,8 @@ loadSyncProfile(\$basedir, \$out_basedir);
@modules_to_sync = keys(%modules) if($#modules_to_sync == -1); @modules_to_sync = keys(%modules) if($#modules_to_sync == -1);
my %allmoduleheadersprivate = map { $_ => 1 } @allmoduleheadersprivate; my %allmoduleheadersprivate = map { $_ => 1 } @allmoduleheadersprivate;
%ignore_for_include_check = map { $_ => 1 } @ignore_for_include_check;
%ignore_for_qt_begin_namespace_check = map { $_ => 1 } @ignore_for_qt_begin_namespace_check;
$isunix = checkUnix; #cache checkUnix $isunix = checkUnix; #cache checkUnix
...@@ -1157,12 +1161,8 @@ if($check_includes) { ...@@ -1157,12 +1161,8 @@ if($check_includes) {
$public_header = 0 if($header eq $_); $public_header = 0 if($header eq $_);
} }
if($public_header) { if($public_header) {
foreach (@ignore_for_include_check) { $public_header = 0 if ($ignore_for_include_check{$header});
$public_header = 0 if($header eq $_); $header_skip_qt_begin_namespace_test = 1 if ($ignore_for_qt_begin_namespace_check{$header});
}
foreach(@ignore_for_qt_begin_namespace_check) {
$header_skip_qt_begin_namespace_test = 1 if ($header eq $_);
}
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment