Example #1
0
        public void ReleasePathCache(Dictionary <StringSegment, object> pathCache, Dictionary <int, object> pathCacheByIndex)
        {
            if (_numberOfAllocatedPathCaches < _allocatePathCaches.Length - 1 && pathCache.Count < 256)
            {
                pathCache.Clear();
                pathCacheByIndex.Clear();

                _allocatePathCaches[++_numberOfAllocatedPathCaches] = new PathCacheHolder(pathCache, pathCacheByIndex);
            }
        }
Example #2
0
        public void ReleasePathCache(Dictionary <StringSegment, object> pathCache, Dictionary <int, object> pathCacheByIndex)
        {
            if (_used >= _items.Length - 1 || pathCache.Count >= 256)
            {
                return;
            }

            pathCache.Clear();
            pathCacheByIndex.Clear();

            _items[++_used] = new PathCacheHolder {
                ByIndex = pathCacheByIndex, Path = pathCache
            };
        }