Skip to content

Commit f4b5a6e

Browse files
committed
Use emplace_back's return value
1 parent 1f726bc commit f4b5a6e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

imgui-SFML.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,7 @@ bool Init(sf::Window& window, sf::RenderTarget& target, bool loadDefaultFont)
246246

247247
bool Init(sf::Window& window, const sf::Vector2f& displaySize, bool loadDefaultFont)
248248
{
249-
s_windowContexts.emplace_back(std::make_unique<WindowContext>(&window));
250-
251-
s_currWindowCtx = s_windowContexts.back().get();
249+
s_currWindowCtx = s_windowContexts.emplace_back(std::make_unique<WindowContext>(&window)).get();
252250
ImGui::SetCurrentContext(s_currWindowCtx->imContext);
253251

254252
ImGuiIO& io = ImGui::GetIO();

0 commit comments

Comments
 (0)