COMMON: Use Path functions in FSNode constructor
Path has an empty() function and equality operator. No need to convert to a String first.
This commit is contained in:
parent
ed41e12fd2
commit
d2b42b52d1
1 changed files with 2 additions and 3 deletions
|
@ -39,12 +39,11 @@ FSNode::FSNode(const Path &p) {
|
|||
assert(g_system);
|
||||
FilesystemFactory *factory = g_system->getFilesystemFactory();
|
||||
AbstractFSNode *tmp = nullptr;
|
||||
String s = p.toString();
|
||||
|
||||
if (s.empty() || s == ".")
|
||||
if (p.empty() || p == Path("."))
|
||||
tmp = factory->makeCurrentDirectoryFileNode();
|
||||
else
|
||||
tmp = factory->makeFileNodePath(s);
|
||||
tmp = factory->makeFileNodePath(p.toString());
|
||||
_realNode = SharedPtr<AbstractFSNode>(tmp);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue