Optional: Use nullopt and implicit construction in /rtc_tools

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=mbonadei@webrtc.org

Bug: None
Change-Id: Iec336d342414dc68b59ba4b4623fdf768f6fb655
Reviewed-on: https://webrtc-review.googlesource.com/23602
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20932}
This commit is contained in:
Oskar Sundbom
2017-11-16 10:55:27 +01:00
committed by Commit Bot
parent deb866360a
commit 59dd482249
3 changed files with 7 additions and 7 deletions

View File

@ -32,7 +32,7 @@ ConfigReader::~ConfigReader() = default;
rtc::Optional<ConfigReader::Config> ConfigReader::GetNextConfig() {
#ifdef WEBRTC_NETWORK_TESTER_PROTO
if (proto_config_index_ >= proto_all_configs_.configs_size())
return rtc::Optional<Config>();
return rtc::nullopt;
auto proto_config = proto_all_configs_.configs(proto_config_index_++);
RTC_DCHECK(proto_config.has_packet_send_interval_ms());
RTC_DCHECK(proto_config.has_packet_size());
@ -41,9 +41,9 @@ rtc::Optional<ConfigReader::Config> ConfigReader::GetNextConfig() {
config.packet_send_interval_ms = proto_config.packet_send_interval_ms();
config.packet_size = proto_config.packet_size();
config.execution_time_ms = proto_config.execution_time_ms();
return rtc::Optional<Config>(config);
return config;
#else
return rtc::Optional<Config>();
return rtc::nullopt;
#endif // WEBRTC_NETWORK_TESTER_PROTO
}