Chromium Code Reviews| 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* candidate) { | |
| 100 size_t original_size = candidates_.size(); | |
| 101 auto new_end = std::remove_if( | |
| 102 candidates_.begin(), candidates_.end(), [candidate](JsepIceCandidate* c) { | |
| 103 return candidate->candidate().MatchesForRemoval(c->candidate()); | |
| 104 }); | |
| 105 candidates_.erase(new_end, candidates_.end()); | |
| 106 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.
| |
| 107 } | |
| 108 | |
| 99 } // namespace webrtc | 109 } // namespace webrtc |
| OLD | NEW |