[MOBY-guts] biomoby commit
Eddie Kawas
kawas at dev.open-bio.org
Thu Nov 6 18:32:34 UTC 2008
kawas
Thu Nov 6 13:32:33 EST 2008
Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators
In directory dev.open-bio.org:/tmp/cvs-serv25509/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators
Modified Files:
Utils.pm
Log Message:
bug fixes:
* swapped IO::Scalar with IO::String for performance reasons (still searching for better method)
* applied patch to Utils.pm (thanks to Kenny Billiau)
* MOSES::MOBY::Cache::Registries no longer does a file read each time a new Registries object is instantiated.
moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators Utils.pm,1.4,1.5
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/Utils.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/Utils.pm 2008/04/29 19:45:10 1.4
+++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/Utils.pm 2008/11/06 18:32:33 1.5
@@ -61,17 +61,29 @@
=cut
+my %full_path_of = ();
+
sub find_file {
my ($self, $default_start, @names) = @_;
my $fixed_part = File::Spec->catfile (@names);
+ return $full_path_of{ $fixed_part } if exists $full_path_of{ $fixed_part };
+
my $result = File::Spec->catfile ($default_start, $fixed_part);
- return $result if -e $result;
+ if (-e $result) {
+ $full_path_of{ $fixed_part } = $result;
+ return $result;
+ }
foreach my $idx (0 .. $#INC) {
- $result = File::Spec->catfile ($INC[$idx], $fixed_part);
- return $result if -e $result;
+ $result = File::Spec->catfile ($INC[$idx], $fixed_part);
+ if (-e $result) {
+ $full_path_of{ $fixed_part } = $result;
+ return $result;
+ }
}
- return File::Spec->catfile ($default_start, $fixed_part);
+ $result = File::Spec->catfile ($default_start, $fixed_part);
+ $full_path_of{ $fixed_part } = $result;
+ return $result;
}
1;
More information about the MOBY-guts
mailing list