소스 검색

replace vector::erase, was missed in a previous commit (ref #186)

Moritz Warning 10 년 전
부모
커밋
def9cf2a6a
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      node/Multicaster.cpp

+ 3 - 1
node/Multicaster.cpp

@@ -330,7 +330,9 @@ void Multicaster::_add(uint64_t now,uint64_t nwid,const MulticastGroup &mg,Multi
 
 	for(std::vector<OutboundMulticast>::iterator tx(gs.txQueue.begin());tx!=gs.txQueue.end();) {
 		if (tx->atLimit()) {
-			gs.txQueue.erase(tx++);
+			// erase element (replace by last)
+			*tx = gs.txQueue.back();
+			gs.txQueue.pop_back();
 		} else {
 			tx->sendIfNew(RR,member);
 			if (tx->atLimit()) {