Kaydet (Commit) aaaa7953 authored tarafından Caolán McNamara's avatar Caolán McNamara

V804: Decreased performance

Change-Id: I6430442cc407e02810d849cf60833abe7c7d2830
üst 749c336d
...@@ -717,7 +717,8 @@ void convert_slashes(char *path) ...@@ -717,7 +717,8 @@ void convert_slashes(char *path)
char* append_slash(char *path) char* append_slash(char *path)
{ {
char *new_string; 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; new_string = path;
} else { } else {
new_string = (char*)malloc(sizeof(char) * (strlen(path) + 2)); new_string = (char*)malloc(sizeof(char) * (strlen(path) + 2));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment