Use ternary conditional operator

This commit is contained in:
rzk3 2023-02-17 21:29:34 -05:00
parent 5161fbc67a
commit 914faa6679
3 changed files with 6 additions and 48 deletions

View File

@ -148,22 +148,8 @@ namespace Emby.Server.Implementations.SyncPlay
/// <value>The playback speed.</value>
public double? PlaybackSpeed
{
get
{
return _playbackSpeed;
}
set
{
if (value is null)
{
_playbackSpeed = null;
}
else
{
_playbackSpeed = Math.Clamp((double)value, 0.1, 10.0);
}
}
get => _playbackSpeed;
set => _playbackSpeed = value is null ? null : Math.Clamp(value.Value, 0.1, 10.0);
}
/// <summary>

View File

@ -119,22 +119,8 @@ namespace MediaBrowser.Model.Session
/// <value>The playback speed.</value>
public double? PlaybackSpeed
{
get
{
return _playbackSpeed;
}
set
{
if (value is null)
{
_playbackSpeed = null;
}
else
{
_playbackSpeed = Math.Clamp((double)value, 0.1, 10.0);
}
}
get => _playbackSpeed;
set => _playbackSpeed = value is null ? null : Math.Clamp(value.Value, 0.1, 10.0);
}
}
}

View File

@ -81,22 +81,8 @@ namespace MediaBrowser.Model.Session
/// <value>The playback speed.</value>
public double? PlaybackSpeed
{
get
{
return _playbackSpeed;
}
set
{
if (value is null)
{
_playbackSpeed = null;
}
else
{
_playbackSpeed = Math.Clamp((double)value, 0.1, 10.0);
}
}
get => _playbackSpeed;
set => _playbackSpeed = value is null ? null : Math.Clamp(value.Value, 0.1, 10.0);
}
}
}