Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //keys and bar are not the concern here
- ConcurrentDictioanry<string, HashSet<string>> foo = new ...;
- foreach(var key in keys) {
- foo.AddOrUpdate(key, new HashSet<string> { bar }, (key, val) => {
- val.Add(bar);
- return val;
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement