Avoid calling real_path when not needed in BufferManager::get_buffer_ifp
This commit is contained in:
parent
c57e76ee41
commit
d9cd5fef8f
|
@ -78,11 +78,11 @@ void BufferManager::delete_buffer_if_exists(StringView name)
|
||||||
|
|
||||||
Buffer* BufferManager::get_buffer_ifp(StringView name)
|
Buffer* BufferManager::get_buffer_ifp(StringView name)
|
||||||
{
|
{
|
||||||
|
auto path = real_path(parse_filename(name));
|
||||||
for (auto& buf : m_buffers)
|
for (auto& buf : m_buffers)
|
||||||
{
|
{
|
||||||
if (buf->name() == name or
|
if (buf->name() == name or
|
||||||
(buf->flags() & Buffer::Flags::File and
|
(buf->flags() & Buffer::Flags::File and buf->name() == path))
|
||||||
real_path(buf->name()) == real_path(parse_filename(name))))
|
|
||||||
return buf.get();
|
return buf.get();
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user