Commit 85388091 authored by Magnus Svensson's avatar Magnus Svensson

Memoize functions that converts between different paths, a given input string...

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
parent 1a4e896e
...@@ -64,6 +64,11 @@ BEGIN { ...@@ -64,6 +64,11 @@ BEGIN {
# in cygwin perl (that uses unix paths) # in cygwin perl (that uses unix paths)
# #
use Memoize;
memoize('mixed_path');
memoize('native_path');
memoize('posix_path');
sub mixed_path { sub mixed_path {
my ($path)= @_; my ($path)= @_;
if (IS_CYGWIN){ if (IS_CYGWIN){
...@@ -76,7 +81,6 @@ sub mixed_path { ...@@ -76,7 +81,6 @@ sub mixed_path {
return $path; return $path;
} }
sub native_path { sub native_path {
my ($path)= @_; my ($path)= @_;
$path=~ s/\//\\/g $path=~ s/\//\\/g
...@@ -84,7 +88,6 @@ sub native_path { ...@@ -84,7 +88,6 @@ sub native_path {
return $path; return $path;
} }
sub posix_path { sub posix_path {
my ($path)= @_; my ($path)= @_;
if (IS_CYGWIN){ if (IS_CYGWIN){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment