mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
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
8764738aef
commit
13e6758df0
1 changed files with 5 additions and 2 deletions
|
@ -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…
Reference in a new issue