diff options
| author | Bond_009 <bond.009@outlook.com> | 2023-02-19 16:52:29 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2023-02-19 16:52:29 +0100 |
| commit | 24a7e210c377bf828f21b5812f25c6545f7de006 (patch) | |
| tree | 0476ae141a3bfc3d597d438a316f8c20bdfaa3c8 /Emby.Server.Implementations/Data | |
| parent | 1deb9f36ba5822249b8359e311635ea9001d5635 (diff) | |
Optimize tryparse
* Don't check for null before
* Don't try different formats when not needed (NumberFormat.Integer is the fast path)
Diffstat (limited to 'Emby.Server.Implementations/Data')
| -rw-r--r-- | Emby.Server.Implementations/Data/SqliteItemRepository.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 602d2a853..90f03995e 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -1195,7 +1195,7 @@ namespace Emby.Server.Implementations.Data Path = RestorePath(path.ToString()) }; - if (long.TryParse(dateModified, NumberStyles.Any, CultureInfo.InvariantCulture, out var ticks) + if (long.TryParse(dateModified, CultureInfo.InvariantCulture, out var ticks) && ticks >= DateTime.MinValue.Ticks && ticks <= DateTime.MaxValue.Ticks) { |
