mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-31 12:14:21 -04:00
Use static lambdas
This commit is contained in:
parent
cd760943a9
commit
76c2775d8c
@ -301,7 +301,7 @@ namespace Emby.Server.Implementations.AppBase
|
|||||||
{
|
{
|
||||||
return _configurations.GetOrAdd(
|
return _configurations.GetOrAdd(
|
||||||
key,
|
key,
|
||||||
(k, configurationManager) =>
|
static (k, configurationManager) =>
|
||||||
{
|
{
|
||||||
var file = configurationManager.GetConfigurationFile(k);
|
var file = configurationManager.GetConfigurationFile(k);
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ namespace Emby.Server.Implementations.Localization
|
|||||||
|
|
||||||
return _dictionaries.GetOrAdd(
|
return _dictionaries.GetOrAdd(
|
||||||
culture,
|
culture,
|
||||||
(key, localizationManager) => localizationManager.GetDictionary(Prefix, key, DefaultCulture + ".json").GetAwaiter().GetResult(),
|
static (key, localizationManager) => localizationManager.GetDictionary(Prefix, key, DefaultCulture + ".json").GetAwaiter().GetResult(),
|
||||||
this);
|
this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ namespace Emby.Server.Implementations.Serialization
|
|||||||
private static XmlSerializer GetSerializer(Type type)
|
private static XmlSerializer GetSerializer(Type type)
|
||||||
=> _serializers.GetOrAdd(
|
=> _serializers.GetOrAdd(
|
||||||
type.FullName ?? throw new ArgumentException($"Invalid type {type}."),
|
type.FullName ?? throw new ArgumentException($"Invalid type {type}."),
|
||||||
(_, t) => new XmlSerializer(t),
|
static (_, t) => new XmlSerializer(t),
|
||||||
type);
|
type);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -25,7 +25,7 @@ namespace MediaBrowser.Controller.Providers
|
|||||||
|
|
||||||
public FileSystemMetadata[] GetFileSystemEntries(string path)
|
public FileSystemMetadata[] GetFileSystemEntries(string path)
|
||||||
{
|
{
|
||||||
return _cache.GetOrAdd(path, (p, fileSystem) => fileSystem.GetFileSystemEntries(p).ToArray(), _fileSystem);
|
return _cache.GetOrAdd(path, static (p, fileSystem) => fileSystem.GetFileSystemEntries(p).ToArray(), _fileSystem);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<FileSystemMetadata> GetFiles(string path)
|
public List<FileSystemMetadata> GetFiles(string path)
|
||||||
@ -69,7 +69,7 @@ namespace MediaBrowser.Controller.Providers
|
|||||||
_filePathCache.TryRemove(path, out _);
|
_filePathCache.TryRemove(path, out _);
|
||||||
}
|
}
|
||||||
|
|
||||||
var filePaths = _filePathCache.GetOrAdd(path, (p, fileSystem) => fileSystem.GetFilePaths(p).ToList(), _fileSystem);
|
var filePaths = _filePathCache.GetOrAdd(path, static (p, fileSystem) => fileSystem.GetFilePaths(p).ToList(), _fileSystem);
|
||||||
|
|
||||||
if (sort)
|
if (sort)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user