From d537476894471dbae75044e8fc5d997f02806950 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Sun, 17 May 2009 13:26:16 +0200 Subject: [PATCH] winapi_test: Simplify the code that builds the list of headers to process. --- tools/winapi/winapi_test | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/tools/winapi/winapi_test b/tools/winapi/winapi_test index 99a72766412..cf3a2b614b3 100755 --- a/tools/winapi/winapi_test +++ b/tools/winapi/winapi_test @@ -47,32 +47,23 @@ if ($options->pack) { push @tests, "pack"; } -my @files = (); +my @files; { my %files; - my %test_dirs; - foreach my $test (@tests) { - my @test_dirs = $tests->get_test_dirs($test); - foreach my $test_dir (@test_dirs) { - my @headers = $tests->get_section($test_dir, $test, "header"); - foreach my $header (@headers) { - $files{"include/$header"} = 1; - } - } - } - - foreach my $test (@tests) { - my @test_dirs = $tests->get_test_dirs($test); - foreach my $test_dir (@test_dirs) { - my @headers = $tests->get_section($test_dir, $test, "header"); - foreach my $header (@headers) { - if($files{"include/$header"}) { + foreach my $test (@tests) + { + foreach my $test_dir ($tests->get_test_dirs($test)) + { + foreach my $header ($tests->get_section($test_dir, $test, "header")) + { + if (!$files{$header}) + { push @files, "include/$header"; - $files{"include/$header"} = 0; - } - } - } + $files{$header} = 1; + } + } + } } }