Refactoring.

This commit is contained in:
Dyego Maas
2022-01-12 20:08:53 -03:00
parent 7a7d92ce24
commit f70b6d42dd

View File

@@ -251,8 +251,12 @@ public class Pattern
{ {
Height = patternLines.Count; Height = patternLines.Count;
Width = patternLines.Max(x => x.Length); Width = patternLines.Max(x => x.Length);
Content = NormalizeWidth(patternLines);
Content = patternLines }
private string[] NormalizeWidth(IReadOnlyCollection<string> patternLines)
{
return patternLines
.Select(x => x.PadRight(Width, ' ')) .Select(x => x.PadRight(Width, ' '))
.ToArray(); .ToArray();
} }