private T GetOrAdd <T>(MetricName name, T metric) where T : IMetric { if (_store.Contains(name)) { return((T)_store[name]); } _store.AddOrUpdate(name, metric); return(metric); }
private T GetOrAdd <T>(MetricName name, T metric) where T : IMetric { if (_store.Contains(name)) { return((T)_store[name]); } var added = _store.AddOrUpdate(name, metric); return(added == null ? metric : (T)added); }