Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. //keys and bar are not the concern here
  2. ConcurrentDictioanry<string, HashSet<string>> foo = new ...;
  3. foreach(var key in keys) {
  4. foo.AddOrUpdate(key, new HashSet<string> { bar }, (key, val) => {
  5. val.Add(bar);
  6. return val;
  7. });
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement