Index: webrtc/modules/audio_coding/neteq/audio_vector.h |
diff --git a/webrtc/modules/audio_coding/neteq/audio_vector.h b/webrtc/modules/audio_coding/neteq/audio_vector.h |
index 756292aa783aabd0449bfd76d61a20ade77dca85..c8722517dd604a598abb6f6b3a5f4454720c78df 100644 |
--- a/webrtc/modules/audio_coding/neteq/audio_vector.h |
+++ b/webrtc/modules/audio_coding/neteq/audio_vector.h |
@@ -110,8 +110,13 @@ class AudioVector { |
virtual bool Empty() const; |
// Accesses and modifies an element of AudioVector. |
- const int16_t& operator[](size_t index) const; |
- int16_t& operator[](size_t index); |
+ inline const int16_t& operator[](size_t index) const { |
kwiberg-webrtc
2017/02/07 14:04:15
The "inline" keyword isn't necessary---functions d
|
+ return array_[(begin_index_ + index) % capacity_]; |
the sun
2017/02/02 19:29:55
Integer division is still surprisingly expensive o
kwiberg-webrtc
2017/02/07 14:04:15
Alternatively, can we be sure that 0 <= begin_inde
hlundin-webrtc
2017/02/13 14:21:13
I did something along those lines.
|
+ } |
+ |
+ inline int16_t& operator[](size_t index) { |
+ return array_[(begin_index_ + index) % capacity_]; |
+ } |
private: |
static const size_t kDefaultInitialSize = 10; |