Charting cleanup

This commit is contained in:
2016-01-06 10:38:29 -05:00
parent 50108dee5a
commit df8256f09b
4 changed files with 49 additions and 82 deletions
-21
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Concurrent;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
@@ -9,26 +8,6 @@ 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)