Skip to content

Commit a77a762

Browse files
committed
genhtml: Reduce path resolution overhead
Reduce overhead when reading coverage data files by consolidating calls to Cwd:cwd(). Signed-off-by: Peter Oberparleiter <[email protected]>
1 parent 526c514 commit a77a762

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

bin/genhtml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ use File::Basename;
6969
use File::Temp qw(tempfile);
7070
use Getopt::Long;
7171
use Digest::MD5 qw(md5_base64);
72-
use Cwd qw/abs_path/;
72+
use Cwd qw/abs_path cwd/;
7373

7474

7575
# Global constants
@@ -297,8 +297,7 @@ our $lcov_func_coverage = 1;
297297
our $lcov_branch_coverage = 0;
298298
our $rc_desc_html = 0; # lcovrc: genhtml_desc_html
299299

300-
our $cwd = `pwd`; # Current working directory
301-
chomp($cwd);
300+
our $cwd = cwd(); # Current working directory
302301

303302

304303
#
@@ -1511,7 +1510,7 @@ sub read_info_file($)
15111510
{
15121511
# Filename information found
15131512
# Retrieve data for new entry
1514-
$filename = File::Spec->rel2abs($1, Cwd::cwd());
1513+
$filename = File::Spec->rel2abs($1, $cwd);
15151514

15161515
if (!File::Spec->file_name_is_absolute($1) &&
15171516
!$notified_about_relative_paths)

0 commit comments

Comments
 (0)