diff --git a/simgear/io/sg_netChannel.cxx b/simgear/io/sg_netChannel.cxx index a4a3d221..44673e11 100644 --- a/simgear/io/sg_netChannel.cxx +++ b/simgear/io/sg_netChannel.cxx @@ -32,10 +32,12 @@ #include #include "sg_netChannel.hxx" +#include #include + #include +#include #include -#include #include @@ -258,18 +260,10 @@ NetChannelPoller::removeChannel(NetChannel* channel) assert(channel); assert(channel->poller == this); channel->poller = NULL; - - // portability: MSVC throws assertion failure when empty - if (channels.empty()) { - return; - } - ChannelList::iterator it = channels.begin(); - for (; it != channels.end(); ++it) { - if (*it == channel) { - channels.erase(it); - return; - } + auto it = std::find(channels.begin(), channels.end(), channel); + if (it != channels.end()) { + channels.erase(it); } }