Commit 13e6758d authored by Magnus Svensson's avatar Magnus Svensson
Browse files

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 8764738a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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){