mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-15 17:25:32 +00:00
Removed some unnecessary dynamic_casts in callback bind helpers
This commit is contained in:
parent
acd46a8353
commit
d54490ec78
@ -32,7 +32,7 @@ void dialog_callback(twidget& caller)
|
||||
{
|
||||
D* dialog = dynamic_cast<D*>(caller.dialog());
|
||||
assert(dialog);
|
||||
twindow* window = dynamic_cast<twindow*>(caller.get_window());
|
||||
twindow* window = caller.get_window();
|
||||
assert(window);
|
||||
(dialog->*fptr)(*window);
|
||||
}
|
||||
@ -42,7 +42,7 @@ typedef boost::function<void(twindow &)> dialog_member_func_type;
|
||||
inline void make_dialog_callback_helper(const dialog_member_func_type & t,
|
||||
twidget & caller)
|
||||
{
|
||||
twindow * window = dynamic_cast<twindow *>(caller.get_window());
|
||||
twindow * window = caller.get_window();
|
||||
assert(window);
|
||||
t(*window);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user