This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quickly create Funcs that memoize expensive computations. | |
// | |
// In this example, ExpensiveMethod is only called once! | |
// | |
// var cached = CachedFunc.Create ((int x, string y) => x + ExpensiveMethod (y)); | |
// for (int i = 0; i < 1000; i++) | |
// cached (123, "hello"); | |
public static class CachedFunc | |
{ |