public LutDataFile GetLutFile(string name) { AbstractDataFile cached; if (_cache.TryGetValue(name, out cached)) return (LutDataFile)cached; var result = new LutDataFile(_carDirectory, name, _acd); _cache[name] = result; return result; }
public LutDataFile GetLutFile(string name) { lock (_cache) { AbstractDataFile cached; if (_cache.TryGetValue(name, out cached) && cached is LutDataFile) { return((LutDataFile)cached); } var result = new LutDataFile(_carDirectory, name, _acd); _cache[name] = result; return(result); } }