OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 if ((*it)->sdp_mid() == candidate->sdp_mid() && | 89 if ((*it)->sdp_mid() == candidate->sdp_mid() && |
90 (*it)->sdp_mline_index() == candidate->sdp_mline_index() && | 90 (*it)->sdp_mline_index() == candidate->sdp_mline_index() && |
91 (*it)->candidate().IsEquivalent(candidate->candidate())) { | 91 (*it)->candidate().IsEquivalent(candidate->candidate())) { |
92 ret = true; | 92 ret = true; |
93 break; | 93 break; |
94 } | 94 } |
95 } | 95 } |
96 return ret; | 96 return ret; |
97 } | 97 } |
98 | 98 |
| 99 int JsepCandidateCollection::remove(const IceCandidateInterface* target) { |
| 100 size_t original_size = candidates_.size(); |
| 101 auto new_end = std::remove_if( |
| 102 candidates_.begin(), candidates_.end(), |
| 103 [target](JsepIceCandidate* candidate) { |
| 104 return target->candidate().IsWeaklyEquivalent(candidate->candidate()); |
| 105 }); |
| 106 candidates_.erase(new_end, candidates_.end()); |
| 107 return candidates_.size() - original_size; |
| 108 } |
| 109 |
99 } // namespace webrtc | 110 } // namespace webrtc |
OLD | NEW |