Permalink
Browse files

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
  • Loading branch information...
1 parent 7f30d75 commit d5b86bc4bf03ad6dfaed866508158de993a25f76 @phpnut phpnut committed Dec 18, 2008
Showing with 5 additions and 5 deletions.
  1. +5 −5 cake/libs/folder.php
View
@@ -261,10 +261,7 @@ function isAbsolute($path) {
* @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 @@ function normalizePath($path) {
* @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).

0 comments on commit d5b86bc

Please sign in to comment.