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:
parent
1a4e896e5f
commit
853880910c
@ -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){
|
||||
|
Loading…
x
Reference in New Issue
Block a user