DS: Avoid needlessly allocating temporary Common::String instances

svn-id: r54329
This commit is contained in:
Max Horn 2010-11-18 17:15:35 +00:00
parent 0001a6b74d
commit 24f4d97901

View File

@ -201,11 +201,11 @@ AbstractFSNode *DSFileSystemNode::getParent() const {
}
Common::SeekableReadStream *DSFileSystemNode::createReadStream() {
return DSFileStream::makeFromPath(getPath().c_str(), false);
return DSFileStream::makeFromPath(getPath(), false);
}
Common::WriteStream *DSFileSystemNode::createWriteStream() {
return DSFileStream::makeFromPath(getPath().c_str(), true);
return DSFileStream::makeFromPath(getPath(), true);
}
//////////////////////////////////////////////////////////////////////////
@ -381,12 +381,12 @@ Common::SeekableReadStream *GBAMPFileSystemNode::createReadStream() {
if (!strncmp(getPath().c_str(), "mp:/", 4)) {
return DSFileStream::makeFromPath(getPath().c_str() + 3, false);
} else {
return DSFileStream::makeFromPath(getPath().c_str(), false);
return DSFileStream::makeFromPath(getPath(), false);
}
}
Common::WriteStream *GBAMPFileSystemNode::createWriteStream() {
return DSFileStream::makeFromPath(getPath().c_str(), true);
return DSFileStream::makeFromPath(getPath(), true);
}
@ -477,8 +477,6 @@ DSFileStream *DSFileStream::makeFromPath(const Common::String &path, bool writeM
}
// Stdio replacements
enum {
MAX_FILE_HANDLES = 32