Skip to content

Commit 0bf3984

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 3a651d0 commit 0bf3984

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/NHibernate/Type/Int32Type.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ public override object Get(DbDataReader rs, int index, ISessionImplementor sessi
3030
{
3131
try
3232
{
33-
return rs[index] switch
33+
var value = rs[index];
34+
return value switch
3435
{
36+
int _ => value,
3537
BigInteger bi => (int) bi,
3638
var c => Convert.ToInt32(c)
3739
};

0 commit comments

Comments
 (0)