From 71981aaecf68b6a0910a18cad67cbba9ac7a1fb1 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Fri, 31 Aug 2012 16:34:12 +0200 Subject: WINTERMUTE: Simplify getNodeForRelativePath --- engines/wintermute/base/file/base_disk_file.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'engines/wintermute/base/file/base_disk_file.cpp') diff --git a/engines/wintermute/base/file/base_disk_file.cpp b/engines/wintermute/base/file/base_disk_file.cpp index 2f7450a999..44a8049121 100644 --- a/engines/wintermute/base/file/base_disk_file.cpp +++ b/engines/wintermute/base/file/base_disk_file.cpp @@ -71,14 +71,11 @@ static Common::FSNode getNodeForRelativePath(const Common::String &filename) { // Get the next path-component by slicing on '\\' Common::String pathPart = path.nextToken(); // Get the next FSNode in the chain, if it exists as a child from the previous. - Common::FSNode nextNode(curNode.getChild(pathPart)); - if (!nextNode.exists()) { + curNode = curNode.getChild(pathPart); + if (!curNode.isReadable()) { // Return an invalid FSNode. return Common::FSNode(); } - if (nextNode.exists() && nextNode.isReadable()) { - curNode = nextNode; - } // Following the comments in common/fs.h, anything not a directory is a file. if (!curNode.isDirectory()) { if (!path.empty()) { -- cgit v1.2.3