Replace old charting curves with new version
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
@@ -8,6 +9,26 @@ using Fasterflect;
|
||||
|
||||
namespace LeafWeb.Core.Utility
|
||||
{
|
||||
public static class MemoizationExtensions
|
||||
{
|
||||
static Func<A, R> ThreadsafeMemoize<A, R>(this Func<A, R> f)
|
||||
{
|
||||
var cache = new ConcurrentDictionary<A, R>();
|
||||
|
||||
return argument => cache.GetOrAdd(argument, f);
|
||||
}
|
||||
//static Func<A, B, R> ThreadsafeMemoize<A, B, R>(this Func<A, B, R> f)
|
||||
//{
|
||||
// var cache = new ConcurrentDictionary<A, ConcurrentDictionary<B,R>>();
|
||||
|
||||
// return (a, b) =>
|
||||
// {
|
||||
|
||||
// return cache.GetOrAdd(a, new ConcurrentDictionary<B, R>()).GetOrAdd(b, f);
|
||||
|
||||
// };
|
||||
//}
|
||||
}
|
||||
public static class ReflectionExtensions
|
||||
{
|
||||
public static string GetPropertyDisplayName<T>(Expression<Func<T, object>> propertyExpression)
|
||||
|
||||
Reference in New Issue
Block a user