Skip to content

Commit f1b0f79

Browse files
committed
Cached a boxed value for Zero in Int32Type
1 parent 7224954 commit f1b0f79

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/NHibernate/Type/Int32Type.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public override string Name
2727
get { return "Int32"; }
2828
}
2929

30-
private static readonly Int32 ZERO = 0;
30+
private static readonly object ZeroObject = 0;
3131

3232
public override object Get(DbDataReader rs, int index, ISessionImplementor session)
3333
{
@@ -128,10 +128,7 @@ public override System.Type PrimitiveClass
128128
get { return typeof(Int32); }
129129
}
130130

131-
public override object DefaultValue
132-
{
133-
get { return ZERO; }
134-
}
131+
public override object DefaultValue => ZeroObject;
135132

136133
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
137134
{

0 commit comments

Comments
 (0)