Micro optimize string concatenation in wxFileSystem::OpenFile()
Concatenate the string only once instead of doing it several times. Compiler might be optimizing this anyhow in release builds, but it definitely helps in at least the debug ones and doesn't cost anything.
This commit is contained in:
parent
97750eb282
commit
b9bd932077
@ -480,14 +480,15 @@ wxFSFile* wxFileSystem::OpenFile(const wxString& location, int flags)
|
||||
// try relative paths first :
|
||||
if (meta != wxT(':') && !m_Path.empty())
|
||||
{
|
||||
const wxString fullloc = m_Path + loc;
|
||||
node = m_Handlers.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxFileSystemHandler *h = (wxFileSystemHandler*) node -> GetData();
|
||||
if (h->CanOpen(m_Path + loc))
|
||||
if (h->CanOpen(fullloc))
|
||||
{
|
||||
s = MakeLocal(h)->OpenFile(*this, m_Path + loc);
|
||||
if (s) { m_LastName = m_Path + loc; break; }
|
||||
s = MakeLocal(h)->OpenFile(*this, fullloc);
|
||||
if (s) { m_LastName = fullloc; break; }
|
||||
}
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user