Skip to content

Commit 1ba413e

Browse files
committed
Code style simplifications in TextureManager
[ci skip]
1 parent f54859a commit 1ba413e

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/video/texture_manager.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -222,23 +222,16 @@ TextureManager::get(const std::string& _filename,
222222
const Sampler& sampler)
223223
{
224224
std::string filename = FileSystem::normalize(_filename);
225-
Texture::Key key;
226-
if (rect)
227-
{
228-
key = Texture::Key(filename, *rect);
229-
}
230-
else
231-
{
232-
key = Texture::Key(filename, Rect());
233-
}
225+
Texture::Key key = Texture::Key(filename, rect ? *rect : Rect());
234226

235227
auto i = m_image_textures.find(key);
236228

237229
TexturePtr texture;
238230
if (i != m_image_textures.end())
239231
texture = i->second.lock();
240232

241-
if (!texture) {
233+
if (!texture)
234+
{
242235
if (rect)
243236
{
244237
texture = create_image_texture(filename, *rect, sampler);

0 commit comments

Comments
 (0)