Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up getting entry to window map for winit
Browse files Browse the repository at this point in the history
Aceeri committed Aug 10, 2022
1 parent a7e635f commit 81e68f6
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions crates/bevy_winit/src/winit_windows.rs
Original file line number Diff line number Diff line change
@@ -142,15 +142,10 @@ impl WinitWindows {
}
}

// TODO: Might be more elegant ways to get return the reference of the winit-window
let id = winit_window.id();
self.windows.insert(winit_window.id(), winit_window);
let created_window = self
.windows
.get(&id)
.expect("Winit should alway have the window it just created");

created_window
self.windows
.entry(winit_window.id())
.insert(winit_window)
.into_mut()
}

/// Get the winit window that is associated with our entity.

0 comments on commit 81e68f6

Please sign in to comment.