Refactor DeepClone methods to use expression-bodied members.

This commit is contained in:
Thorsten Sommer 2025-05-24 18:11:07 +02:00
parent 59373a0e60
commit fc103ff346
Signed by untrusted user who does not match committer: tsommer
GPG Key ID: 371BBA77A02C0108
3 changed files with 18 additions and 27 deletions

View File

@ -30,9 +30,7 @@ public class ContentBlock
/// </summary> /// </summary>
public bool HideFromUser { get; init; } public bool HideFromUser { get; init; }
public ContentBlock DeepClone() public ContentBlock DeepClone() => new()
{
return new()
{ {
Time = this.Time, Time = this.Time,
ContentType = this.ContentType, ContentType = this.ContentType,
@ -41,4 +39,3 @@ public class ContentBlock
HideFromUser = this.HideFromUser, HideFromUser = this.HideFromUser,
}; };
} }
}

View File

@ -34,16 +34,13 @@ public sealed class ContentImage : IContent, IImageSource
} }
/// <inheritdoc /> /// <inheritdoc />
public IContent DeepClone() public IContent DeepClone() => new ContentImage
{
return new ContentImage
{ {
Source = this.Source, Source = this.Source,
InitialRemoteWait = this.InitialRemoteWait, InitialRemoteWait = this.InitialRemoteWait,
IsStreaming = this.IsStreaming, IsStreaming = this.IsStreaming,
SourceType = this.SourceType, SourceType = this.SourceType,
}; };
}
#endregion #endregion

View File

@ -126,15 +126,12 @@ public sealed class ContentText : IContent
} }
/// <inheritdoc /> /// <inheritdoc />
public IContent DeepClone() public IContent DeepClone() => new ContentText
{
return new ContentText
{ {
Text = this.Text, Text = this.Text,
InitialRemoteWait = this.InitialRemoteWait, InitialRemoteWait = this.InitialRemoteWait,
IsStreaming = this.IsStreaming, IsStreaming = this.IsStreaming,
}; };
}
#endregion #endregion