Closes #5733, Avoid delegation overhead in Folder::correctSlashFor();

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7939 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2008-12-18 00:27:10 +00:00
parent 7f30d75739
commit d5b86bc4bf

View file

@ -261,10 +261,7 @@ class Folder extends Object {
* @static
*/
function normalizePath($path) {
if (Folder::isWindowsPath($path)) {
return '\\';
}
return '/';
return Folder::correctSlashFor($path);
}
/**
* Returns a correct set of slashes for given $path. (\\ for Windows paths and / for other paths.)
@ -275,7 +272,10 @@ class Folder extends Object {
* @static
*/
function correctSlashFor($path) {
return Folder::normalizePath($path);
if (Folder::isWindowsPath($path)) {
return '\\';
}
return '/';
}
/**
* Returns $path with added terminating slash (corrected for Windows or other OS).