Alexey Zimarev Profile picture
Dev Advocate @ Event Store. Organiser of @DDD_Norway, author of Hands-On Domain-Driven Design with .NET Core. Creator of https://t.co/076pYQCSoo Views are my own.
Dec 17, 2019 20 tweets 3 min read
I might be missing something but why people from Microsoft write code like this? github.com/open-telemetry… So I changed the method of 36 lines with 4 ifs and two nested fors with this:
this.entries = carrier is NoopDistributedContextCarrier || entries == null
? Enumerable.Empty<DistributedContextEntry>()
: entries.Where(x => x != default).Distinct();