From 65974ceabc5b8c300fcd565f95fb33e8864f74d4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Dec 2016 20:04:16 +0100 Subject: [PATCH] PlaylistFile: remove redundant existence check --- src/PlaylistFile.cxx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx index 99d343b0d..18cbd8594 100644 --- a/src/PlaylistFile.cxx +++ b/src/PlaylistFile.cxx @@ -366,10 +366,6 @@ spl_append_uri(const char *utf8file, static void spl_rename_internal(Path from_path_fs, Path to_path_fs) { - if (!FileExists(from_path_fs)) - throw PlaylistError(PlaylistResult::NO_SUCH_LIST, - "No such playlist"); - if (FileExists(to_path_fs)) throw PlaylistError(PlaylistResult::LIST_EXISTS, "Playlist exists already"); @@ -377,7 +373,7 @@ spl_rename_internal(Path from_path_fs, Path to_path_fs) try { RenameFile(from_path_fs, to_path_fs); } catch (const std::system_error &e) { - if (IsPathNotFound(e)) + if (IsFileNotFound(e)) throw PlaylistError(PlaylistResult::NO_SUCH_LIST, "No such playlist"); else