item == identifier would always evaluate to false because of reference comparison, leading to distinguisherFound always being false.
As a result, the identifier would always get added to tenantResult.Distinguishers, even when already part of tenantResult.Distinguishers.
Using item.Equals(identifier) works as intended, overloading the == operator of TenantIdentifier might be worth looking into to prevent regressions of the same sort.
Also, an unnecessary cache update was performed on line 67 (now 68) if identifier and item were identical.
item == identifier
would always evaluate tofalse
because of reference comparison, leading todistinguisherFound
always beingfalse
.As a result, the
identifier
would always get added totenantResult.Distinguishers
, even when already part oftenantResult.Distinguishers
.Using
item.Equals(identifier)
works as intended, overloading the==
operator ofTenantIdentifier
might be worth looking into to prevent regressions of the same sort.Also, an unnecessary cache update was performed on line 67 (now 68) if
identifier
anditem
were identical.