V804: Decreased performance

Change-Id: I6430442cc407e02810d849cf60833abe7c7d2830
This commit is contained in:
Caolán McNamara
2015-03-02 11:04:04 +00:00
parent 749c336d30
commit aaaa7953f5

View File

@@ -717,7 +717,8 @@ void convert_slashes(char *path)
char* append_slash(char *path)
{
char *new_string;
if ((path[strlen(path) - 1] == '/') || (path[strlen(path) - 1] == '\\')) {
const char cLastChar = path[strlen(path) - 1];
if (cLastChar == '/' || cLastChar == '\\') {
new_string = path;
} else {
new_string = (char*)malloc(sizeof(char) * (strlen(path) + 2));