Skip to content

Instantly share code, notes, and snippets.

@Alan-FGR
Created November 26, 2016 13:34
Show Gist options
  • Save Alan-FGR/4abdddd1d0317c2d8ed6a65c0f9ce925 to your computer and use it in GitHub Desktop.
Save Alan-FGR/4abdddd1d0317c2d8ed6a65c0f9ce925 to your computer and use it in GitHub Desktop.
Why?
// OK
internal static class Cache
{
private static readonly ResourceCache _cache;
static Cache()
{
_cache = AtomicNET.GetSubsystem<ResourceCache>();
}
public static T Get<T>(string path) where T : Resource
{
return _cache.Get<T>(path);
}
}
// NOT OK?
internal static class Cache
{
private static readonly ResourceCache _cache = AtomicNET.GetSubsystem<ResourceCache>();
public static T Get<T>(string path) where T : Resource
{
return _cache.Get<T>(path);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment