MCPcopy Create free account
hub / github.com/Segs/Segs / removeEndpointFromUnorderedVector

Function removeEndpointFromUnorderedVector

Projects/CoX/Common/Servers/MessageBus.cpp:30–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 };
29
30 void removeEndpointFromUnorderedVector(std::vector<MessageBusEndpoint *> &vec,const MessageBusEndpoint *to_remove)
31 {
32 for(int i=0,total=vec.size(); i<total; ++i)
33 {
34 if(vec[i]==to_remove)
35 {
36 // swap - and - pop for very fast element removal
37 std::swap(vec[i],vec.back());
38 vec.pop_back();
39 return;
40 }
41 }
42 }
43 ACE_Time_Value statistic_update_interval(0,1000*1000*15);
44} // namespace
45

Callers 1

unsubscribeMethod · 0.85

Calls 2

swapFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected