use strrchr instead of a loop

master
Andrzej Rybczak 18 years ago
parent 0fef77da81
commit 3955606c72
  1. 11
      src/song.cpp

@ -58,14 +58,9 @@ Song::Song(mpd_Song *s, bool copy_ptr) : itsSong(s),
if (itsSong->file)
{
for (size_t i = file_len-1; i < file_len; i--)
{
if (itsSong->file[i] == '/')
{
itsSlash = i;
break;
}
}
char *tmp = strrchr(itsSong->file, '/');
if (tmp)
itsSlash = tmp-itsSong->file;
if (strncmp(itsSong->file, "http://", 7) == 0)
isStream = 1;
}

Loading…
Cancel
Save