Memoize functions that converts between different paths, a given input string will always return the same output. This save a lot of calls to cygpath for example

This commit is contained in:
Magnus Svensson 2008-09-22 19:15:55 +03:00
parent 8764738aef
commit 13e6758df0

View file

@ -64,6 +64,11 @@ BEGIN {
# in cygwin perl (that uses unix paths)
#
use Memoize;
memoize('mixed_path');
memoize('native_path');
memoize('posix_path');
sub mixed_path {
my ($path)= @_;
if (IS_CYGWIN){
@ -76,7 +81,6 @@ sub mixed_path {
return $path;
}
sub native_path {
my ($path)= @_;
$path=~ s/\//\\/g
@ -84,7 +88,6 @@ sub native_path {
return $path;
}
sub posix_path {
my ($path)= @_;
if (IS_CYGWIN){