Chromium Code Reviews| Index: webrtc/api/datachannel.cc |
| diff --git a/webrtc/api/datachannel.cc b/webrtc/api/datachannel.cc |
| index 6b13bf2c705ae7152c9ce4fa6edef00f9ce92340..32da5355be79aa9203d1965d1c72a8eb65a6823b 100644 |
| --- a/webrtc/api/datachannel.cc |
| +++ b/webrtc/api/datachannel.cc |
| @@ -31,7 +31,7 @@ bool SctpSidAllocator::AllocateSid(rtc::SSLRole role, int* sid) { |
| int potential_sid = (role == rtc::SSL_CLIENT) ? 0 : 1; |
| while (!IsSidAvailable(potential_sid)) { |
| potential_sid += 2; |
| - if (potential_sid > static_cast<int>(cricket::kMaxSctpSid)) { |
| + if (potential_sid >= static_cast<int>(cricket::kMaxSctpStreams)) { |
|
pthatcher1
2016/08/22 23:09:30
I liked the way it read before: "if sid > maxSid {
Taylor Brandstetter
2016/08/23 00:53:14
Done.
|
| return false; |
| } |
| } |
| @@ -57,7 +57,7 @@ void SctpSidAllocator::ReleaseSid(int sid) { |
| } |
| bool SctpSidAllocator::IsSidAvailable(int sid) const { |
| - if (sid < 0 || sid > static_cast<int>(cricket::kMaxSctpSid)) { |
| + if (sid < 0 || sid >= static_cast<int>(cricket::kMaxSctpStreams)) { |
| return false; |
| } |
| return used_sids_.find(sid) == used_sids_.end(); |