Skip to content

Commit b3fd219

Browse files
iamcarbonabergs
authored andcommitted
Eliminate list allocation when allowedCredentials is null
1 parent 88c07e4 commit b3fd219

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Src/Fido2.Models/AssertionOptions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections.Generic;
1+
using System;
2+
using System.Collections.Generic;
23
using System.Text.Json;
34
using System.Text.Json.Serialization;
45

@@ -58,7 +59,7 @@ public static AssertionOptions Create(Fido2Configuration config, byte[] challeng
5859
Challenge = challenge,
5960
Timeout = config.Timeout,
6061
RpId = config.ServerDomain,
61-
AllowCredentials = allowedCredentials ?? new List<PublicKeyCredentialDescriptor>(),
62+
AllowCredentials = allowedCredentials ?? Array.Empty<PublicKeyCredentialDescriptor>(),
6263
UserVerification = userVerification,
6364
Extensions = extensions
6465
};

0 commit comments

Comments
 (0)