Skip to content

Commit 990d515

Browse files
committed
Avoided extra boxing/unboxing for int type in Int32Type
and use the previous implementation as a fallback for the rest types
1 parent 9f30007 commit 990d515

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/NHibernate/Type/Int32Type.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ public override object Get(DbDataReader rs, int index, ISessionImplementor sessi
3131
{
3232
try
3333
{
34-
return rs[index] switch
34+
var value = rs[index];
35+
return value switch
3536
{
37+
int _ => value,
3638
BigInteger bi => (int) bi,
3739
var c => Convert.ToInt32(c)
3840
};

0 commit comments

Comments
 (0)