update: make the "song" variable more local
This commit is contained in:
parent
78899051c0
commit
9604f88fe7
@ -250,12 +250,11 @@ static enum update_return
|
|||||||
updateInDirectory(struct directory *directory,
|
updateInDirectory(struct directory *directory,
|
||||||
const char *name, const struct stat *st)
|
const char *name, const struct stat *st)
|
||||||
{
|
{
|
||||||
struct song *song;
|
|
||||||
|
|
||||||
if (S_ISREG(st->st_mode) && hasMusicSuffix(name, 0)) {
|
if (S_ISREG(st->st_mode) && hasMusicSuffix(name, 0)) {
|
||||||
const char *shortname = mpd_basename(name);
|
const char *shortname = mpd_basename(name);
|
||||||
|
struct song *song = songvec_find(&directory->songs, shortname);
|
||||||
|
|
||||||
if (!(song = songvec_find(&directory->songs, shortname))) {
|
if (song == NULL) {
|
||||||
song = song_file_load(shortname, directory);
|
song = song_file_load(shortname, directory);
|
||||||
if (song == NULL)
|
if (song == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user