Optional: Use nullopt and implicit construction in /test/fuzzers
Changes places where we explicitly construct an Optional to instead use nullopt or the requisite value type only. This CL was uploaded by git cl split. R=henrik.lundin@webrtc.org Bug: None Change-Id: I446549a385e020c68bafc83d5dd1aabd11d7ae18 Reviewed-on: https://webrtc-review.googlesource.com/23563 Commit-Queue: Oskar Sundbom <ossu@webrtc.org> Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20718}
This commit is contained in:

committed by
Commit Bot

parent
2c8c8e26fc
commit
df0822b102
@ -125,9 +125,9 @@ void FuzzAudioProcessing(const uint8_t* data,
|
||||
|
||||
rtc::Optional<bool> ParseBool(const uint8_t** data, size_t* remaining_size) {
|
||||
if (1 > *remaining_size) {
|
||||
return rtc::Optional<bool>();
|
||||
return rtc::nullopt;
|
||||
}
|
||||
auto res = rtc::Optional<bool>((**data) % 2);
|
||||
auto res = (**data) % 2;
|
||||
*data += 1;
|
||||
*remaining_size -= 1;
|
||||
return res;
|
||||
@ -135,9 +135,9 @@ rtc::Optional<bool> ParseBool(const uint8_t** data, size_t* remaining_size) {
|
||||
|
||||
rtc::Optional<uint8_t> ParseByte(const uint8_t** data, size_t* remaining_size) {
|
||||
if (1 > *remaining_size) {
|
||||
return rtc::Optional<uint8_t>();
|
||||
return rtc::nullopt;
|
||||
}
|
||||
auto res = rtc::Optional<uint8_t>((**data));
|
||||
auto res = **data;
|
||||
*data += 1;
|
||||
*remaining_size -= 1;
|
||||
return res;
|
||||
|
@ -66,7 +66,7 @@ class FuzzRtpInput : public NetEqInput {
|
||||
}
|
||||
|
||||
rtc::Optional<int64_t> NextPacketTime() const override {
|
||||
return rtc::Optional<int64_t>(packet_->time_ms);
|
||||
return packet_->time_ms;
|
||||
}
|
||||
|
||||
rtc::Optional<int64_t> NextOutputEventTime() const override {
|
||||
@ -87,7 +87,7 @@ class FuzzRtpInput : public NetEqInput {
|
||||
|
||||
rtc::Optional<RTPHeader> NextHeader() const override {
|
||||
RTC_DCHECK(packet_);
|
||||
return rtc::Optional<RTPHeader>(packet_->header);
|
||||
return packet_->header;
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -146,11 +146,11 @@ class FuzzSignalInput : public NetEqInput {
|
||||
}
|
||||
|
||||
rtc::Optional<int64_t> NextPacketTime() const override {
|
||||
return rtc::Optional<int64_t>(packet_->time_ms);
|
||||
return packet_->time_ms;
|
||||
}
|
||||
|
||||
rtc::Optional<int64_t> NextOutputEventTime() const override {
|
||||
return rtc::Optional<int64_t>(next_output_event_ms_);
|
||||
return next_output_event_ms_;
|
||||
}
|
||||
|
||||
std::unique_ptr<PacketData> PopPacket() override {
|
||||
@ -183,7 +183,7 @@ class FuzzSignalInput : public NetEqInput {
|
||||
|
||||
rtc::Optional<RTPHeader> NextHeader() const override {
|
||||
RTC_DCHECK(packet_);
|
||||
return rtc::Optional<RTPHeader>(packet_->header);
|
||||
return packet_->header;
|
||||
}
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user