public static void Update( Func<string, SourceLogFilter, SourceLogFilter> mapper ) { // Keys take a snapshot. // Iterating on the Keys is the preferred method for ConcurrentDictionary. foreach( var f in _filters.Keys ) { SourceLogFilter filter; if( _filters.TryGetValue( f, out filter ) ) { SetFilter( mapper( f, filter ), f ); } } }