Skip to content

Commit

Permalink
Avoided extra boxing/unboxing for int type in Int32Type
Browse files Browse the repository at this point in the history
and use the previous implementation as a fallback for the rest types
  • Loading branch information
wilbit committed Jun 7, 2024
1 parent 3a651d0 commit 0bf3984
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/NHibernate/Type/Int32Type.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ public override object Get(DbDataReader rs, int index, ISessionImplementor sessi
{
try
{
return rs[index] switch
var value = rs[index];
return value switch
{
int _ => value,
BigInteger bi => (int) bi,
var c => Convert.ToInt32(c)
};
Expand Down

0 comments on commit 0bf3984

Please sign in to comment.