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:
committed by
Commit bot
parent
a7b682aa18
commit
280eb224e2
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user