Easiest to use output from Split directly, rather than via a List

This commit is contained in:
Adrian Conlon
2024-09-17 20:08:45 +01:00
parent e221c5a0f0
commit 93c753c596
+2 -2
View File
@@ -110,12 +110,12 @@
protected static long ExtractHexLong(string value) => ExtractHexValue<long>(value);
protected static int ExtractInteger(string value) => ExtractNumericValue<int>(value);
protected static long ExtractLong(string value) => ExtractNumericValue<long>(value);
protected static List<string> ExtractCompoundString(string value) => new(value.Split('+'));
protected static string[] ExtractCompoundString(string value) => value.Split('+');
protected static List<int> ExtractCompoundInteger(string value)
{
var elements = ExtractCompoundString(value);
var returned = new List<int>(elements.Count);
var returned = new List<int>(elements.Length);
foreach (var element in elements)
{
returned.Add(ExtractInteger(element));