public DirCacheTree getCacheTree(bool build) { if (build) { if (_cacheTree == null) { _cacheTree = new DirCacheTree(); } _cacheTree.validate(_sortedEntries, _entryCnt, 0, 0); } return _cacheTree; }
/// <summary> /// Create a new iterator for an already loaded DirCache instance. /// <para/> /// The iterator implementation may copy part of the cache's data during /// construction, so the cache must be Read in prior to creating the /// iterator. /// </summary> /// <param name="dc"> /// The cache to walk. It must be already loaded into memory. /// </param> public DirCacheIterator(DirCache dc) { Cache = dc; Tree = dc.getCacheTree(true); TreeStart = 0; TreeEnd = Tree.getEntrySpan(); SubtreeId = new byte[Constants.OBJECT_ID_LENGTH]; if (!eof()) { ParseEntry(); } }