Make AudioVector::operator[] inline and modify the index calculation to avoid the modulo operation.

BUG=webrtc:7159

Review-Url: https://codereview.webrtc.org/2670643007
Cr-Commit-Position: refs/heads/master@{#16627}
This commit is contained in:
henrik.lundin
2017-02-15 02:53:05 -08:00
committed by Commit bot
parent a7b682aa18
commit 280eb224e2
2 changed files with 21 additions and 10 deletions

View File

@ -284,14 +284,6 @@ bool AudioVector::Empty() const {
return begin_index_ == end_index_;
}
const int16_t& AudioVector::operator[](size_t index) const {
return array_[(begin_index_ + index) % capacity_];
}
int16_t& AudioVector::operator[](size_t index) {
return array_[(begin_index_ + index) % capacity_];
}
void AudioVector::Reserve(size_t n) {
if (capacity_ > n)
return;