Skip to content

Commit e579f67

Browse files
authored
Use know list size in EncodeHex (#599)
1 parent a82ea29 commit e579f67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/Bogus/Hashids.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ public virtual string EncodeHex(string hex)
100100
if( !hexValidator.IsMatch(hex) )
101101
return string.Empty;
102102

103-
var numbers = new List<long>();
104103
var matches = hexSplitter.Matches(hex);
104+
var numbers = new List<long>(matches.Count);
105105

106106
foreach( Match match in matches )
107107
{

0 commit comments

Comments
 (0)