Skip to content

Commit df10294

Browse files
committed
Removed reference check as it's no longer necessary.
1 parent 60b21b0 commit df10294

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/BenchmarkDotNet/Engines/Consumer.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,8 @@ public void Consume<T>(in T value)
139139
Volatile.Write(ref longHolder, (long)(object)value);
140140
else if (typeof(T) == typeof(ulong))
141141
Volatile.Write(ref ulongHolder, (ulong)(object)value);
142-
else if (default(T) == null && !typeof(T).IsValueType)
143-
DeadCodeEliminationHelper.KeepAliveWithoutBoxing(value);
144142
else
145-
DeadCodeEliminationHelper.KeepAliveWithoutBoxingReadonly(value); // non-primitive value types
143+
DeadCodeEliminationHelper.KeepAliveWithoutBoxingReadonly(value); // non-primitive and nullable value types
146144
}
147145

148146
internal static bool IsConsumable(Type type)

0 commit comments

Comments
 (0)