internal FsFileData GetFile(MD5Checksum?checksum) { Monitor.Enter(_fileData); try { if (checksum.HasValue) { ComparisonGroupedData groupData; if (_fileData.ContainsKey(checksum.Value)) { groupData = _fileData[checksum.Value]; } else { groupData = new ComparisonGroupedData(); _fileData.Add(checksum.Value, groupData); } return(groupData.GetFile(checksum.Value, _length)); } if (_noChecksum == null) { _noChecksum = new FsFileData(_length); } return(_noChecksum); } finally { Monitor.Exit(_fileData); } }
internal FsFileData GetFile(FileComparisonInfo comparisonInfo) { Monitor.Enter(_fileData); try { ComparisonGroupedData groupData; if (_fileData.ContainsKey(comparisonInfo.Checksum)) { groupData = _fileData[comparisonInfo.Checksum]; } else { groupData = new ComparisonGroupedData(); _fileData.Add(comparisonInfo.Checksum, groupData); } return(groupData.GetFile(comparisonInfo, _length)); } finally { Monitor.Exit(_fileData); } }