Skip to content

Commit 55bbe03

Browse files
committed
#381 Fix - optimized code
1 parent 79c20e7 commit 55bbe03

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/phpFastCache/Util/Directory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ public static function getAbsolutePath($path)
132132
$absolutes[] = $part;
133133
}
134134
}
135-
$prefix = substr(__FILE__, 0, 1) == '/' ? '/' : '';
135+
$__FILE__ = __FILE__; // allows to dereference char
136+
$prefix = $__FILE__[0] === DIRECTORY_SEPARATOR ? DIRECTORY_SEPARATOR : '';
136137
return $prefix . implode(DIRECTORY_SEPARATOR, $absolutes);
137138
}
138139
}

0 commit comments

Comments
 (0)