While using MEL logging, the state object is commonly either FormattedLogValues or LogValues. These types are private structs and implement the IReadOnlyCollection interface. So, there is no way to easily avoid boxing, but we can save enumerator object allocation by using a for-loop instead of foreach.