Skip to content

Commit 3ab0369

Browse files
committed
Time::HiRes: avoid importing via export_to_level
The export_to_level function forces Exporter to always load Exporter::Heavy. This can be avoided by only using Exporter::import. Time::HiRes's import is only trying to prevent exports of unimplemented functions and doesn't need to make any modifications to its arguments. This means doing a goto &Exporter::import will do everything needed.
1 parent 91c779a commit 3ab0369

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

dist/Time-HiRes/HiRes.pm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval
5050
stat lstat utime
5151
);
5252

53-
our $VERSION = '1.9777';
53+
our $VERSION = '1.9778';
5454
our $XS_VERSION = $VERSION;
5555
$VERSION = eval $VERSION;
5656

@@ -74,8 +74,7 @@ sub AUTOLOAD {
7474
}
7575

7676
sub import {
77-
my $this = shift;
78-
for my $i (@_) {
77+
for my $i (@_[1 .. $#_]) {
7978
if (($i eq 'clock_getres' && !&d_clock_getres) ||
8079
($i eq 'clock_gettime' && !&d_clock_gettime) ||
8180
($i eq 'clock_nanosleep' && !&d_clock_nanosleep) ||
@@ -88,7 +87,7 @@ sub import {
8887
Carp::croak("Time::HiRes::$i(): unimplemented in this platform");
8988
}
9089
}
91-
Time::HiRes->export_to_level(1, $this, @_);
90+
goto &Exporter::import;
9291
}
9392

9493
XSLoader::load( 'Time::HiRes', $XS_VERSION );

0 commit comments

Comments
 (0)