Skip to content

Commit

Permalink
Avoid temporary object when creating new textures from disk
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Jul 31, 2017
1 parent 6062b6c commit 13995ce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/image.cpp
Expand Up @@ -1314,8 +1314,7 @@ static texture create_texture_from_file(const image::locator& loc)

// TODO: if we need to use SDL_RWops we should use IMG_LoadTexture_RW here instead.
{
texture temp(IMG_LoadTexture(renderer, location.c_str()));
res = temp;
res.assign(IMG_LoadTexture(renderer, location.c_str()));
}

// TODO: decide what to do about this.
Expand Down

0 comments on commit 13995ce

Please sign in to comment.