Index: talk/app/webrtc/jsepicecandidate.cc |
diff --git a/talk/app/webrtc/jsepicecandidate.cc b/talk/app/webrtc/jsepicecandidate.cc |
index 768bd0a281bc3ee7097a116f00e3e4cc677c8644..091832c40d4c403a97b8e9989af60fd42df44faa 100644 |
--- a/talk/app/webrtc/jsepicecandidate.cc |
+++ b/talk/app/webrtc/jsepicecandidate.cc |
@@ -96,4 +96,14 @@ bool JsepCandidateCollection::HasCandidate( |
return ret; |
} |
+int JsepCandidateCollection::remove(const IceCandidateInterface* candidate) { |
+ size_t original_size = candidates_.size(); |
+ auto new_end = std::remove_if( |
+ candidates_.begin(), candidates_.end(), [candidate](JsepIceCandidate* c) { |
+ return candidate->candidate().MatchesForRemoval(c->candidate()); |
+ }); |
+ candidates_.erase(new_end, candidates_.end()); |
+ return candidates_.size() - original_size; |
Taylor Brandstetter
2016/02/10 21:58:08
This will return a negative number, is that right?
honghaiz3
2016/02/12 00:56:55
Thanks for the good catch.
|
+} |
+ |
} // namespace webrtc |