Change vector<const T> with const vector<T>

As described in the issue. This won't compile under most compilers,
at least that what godbolt indicated.
So instead, using const vector<T> to prevent the compilation errors. Keep in mind this is a bit more restrictive as it also implies constness on the vector itself and not only its members, meaning we cannot push/pop.


Bug: webrtc:15829
Change-Id: I19c1223f0a3c56082da75b39c2afe152ae43a3a7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337960
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41695}
This commit is contained in:
Dor Hen 2024-02-05 07:58:10 -08:00 committed by WebRTC LUCI CQ
parent 68831d28c7
commit 3e613c2590

View file

@ -59,7 +59,7 @@ class MockChannelSend {
};
std::unique_ptr<TransformableAudioFrameInterface> CreateMockReceiverFrame(
std::vector<const uint32_t> csrcs) {
const std::vector<uint32_t>& csrcs) {
std::unique_ptr<MockTransformableAudioFrame> mock_frame =
std::make_unique<NiceMock<MockTransformableAudioFrame>>();
rtc::ArrayView<const uint8_t> payload(mock_data);
@ -168,7 +168,7 @@ TEST(ChannelSendFrameTransformerDelegateTest,
delegate->Init();
ASSERT_TRUE(callback);
std::vector<const uint32_t> csrcs = {123, 234, 345, 456};
const std::vector<uint32_t> csrcs = {123, 234, 345, 456};
EXPECT_CALL(mock_channel, SendFrame).Times(0);
EXPECT_CALL(mock_channel, SendFrame(_, 0, 0, ElementsAreArray(mock_data), _,
ElementsAreArray(csrcs)));