More review

This commit is contained in:
cvium 2021-06-05 20:16:04 +02:00
parent cfba7daa50
commit 9111730a0a
2 changed files with 3 additions and 5 deletions

View File

@ -1073,10 +1073,7 @@ namespace Emby.Server.Implementations.Data
}
// Extremely unlikely, but somehow one or more of the image strings were malformed. Cut the array.
var newResult = new ItemImageInfo[position];
Array.Copy(result, newResult, position);
return newResult;
return result[..position];
}
private void AppendItemImageInfo(StringBuilder bldr, ItemImageInfo image)

View File

@ -17,7 +17,8 @@ namespace MediaBrowser.Common.Extensions
/// <returns>The updated string builder.</returns>
public static StringBuilder AppendJoinInSingleQuotes(this StringBuilder builder, char delimiter, IReadOnlyList<string> values)
{
for (var i = 0; i < values.Count; i++)
var len = values.Count;
for (var i = 0; i < len; i++)
{
builder.Append('\'')
.Append(values[i])