diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2011-10-23 13:11:46 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2011-10-23 13:11:46 +0200 |
commit | ce3970fd0a2890b88485c2723e7af1633544c741 (patch) | |
tree | 366eafb66421457ad9e0b62172e8d8c1c37477cc /Bugzilla/RNG.pm | |
parent | e9f859e128e5c9c6e74a95c79ab60ed123a94c14 (diff) | |
download | bugzilla-ce3970fd0a2890b88485c2723e7af1633544c741.tar.gz bugzilla-ce3970fd0a2890b88485c2723e7af1633544c741.tar.xz |
Bug 696541: Only load some external modules when needed, to improve the load time of pages
r/a=mkanat
Diffstat (limited to 'Bugzilla/RNG.pm')
-rw-r--r-- | Bugzilla/RNG.pm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Bugzilla/RNG.pm b/Bugzilla/RNG.pm index caa63bae2..9ee6d49e5 100644 --- a/Bugzilla/RNG.pm +++ b/Bugzilla/RNG.pm @@ -24,7 +24,6 @@ use strict; use base qw(Exporter); use Bugzilla::Constants qw(ON_WINDOWS); -use IO::File; use Math::Random::ISAAC; use if ON_WINDOWS, 'Win32::API'; @@ -156,14 +155,14 @@ sub _get_seed { sub _read_seed_from { my ($from) = @_; - my $fh = IO::File->new($from, "r") or die "$from: $!"; + open(my $fh, '<', $from) or die "$from: $!"; my $buffer; - $fh->read($buffer, SEED_SIZE); + read($fh, $buffer, SEED_SIZE); if (length($buffer) < SEED_SIZE) { die "Could not read enough seed bytes from $from, got only " . length($buffer); } - $fh->close; + close $fh; return $buffer; } |