mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-22 10:55:15 -04:00
Remove regex check in Snowflake.TryParse
(#980)
This commit is contained in:
parent
d9c06bacda
commit
67b31c5f68
1 changed files with 1 additions and 2 deletions
|
@ -1,7 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
|
|
||||||
namespace DiscordChatExporter.Core.Discord;
|
namespace DiscordChatExporter.Core.Discord;
|
||||||
|
|
||||||
|
@ -29,7 +28,7 @@ public partial record struct Snowflake
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// As number
|
// As number
|
||||||
if (Regex.IsMatch(str, @"^\d+$") && ulong.TryParse(str, NumberStyles.Number, formatProvider, out var value))
|
if (ulong.TryParse(str, NumberStyles.None, formatProvider, out var value))
|
||||||
{
|
{
|
||||||
return new Snowflake(value);
|
return new Snowflake(value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue