コード例 #1
0
        public static void Set <T>(Options opts, int rawEstimate)
        {
            var finalEstimate = CalculateFinalEstimate(rawEstimate);

            var key = CapacityKey.For(typeof(T), opts);

            Cache[key] = finalEstimate;
        }
コード例 #2
0
        public static int Get(Type type, Options opts)
        {
            var key = CapacityKey.For(type, opts);

            var ret = Cache[key] ?? DefaultCapacity;

            return((int)ret);
        }