Permalink
Browse files

NH-1124 fix

SVN: branches/1.2.x@2998
  • Loading branch information...
Sergey Koshcheyev
Sergey Koshcheyev committed Sep 21, 2007
1 parent 7b911bf commit 9a26795704ed56c95cdb18084a624dc44efe33fe
Showing with 5 additions and 9 deletions.
  1. +5 −9 src/NHibernate/Type/ComponentType.cs
@@ -293,9 +293,8 @@ public override void NullSafeSet(IDbCommand st, object value, int begin, bool[]
{
object[] subvalues = NullSafeGetValues(value);
- int subvaluesIndex = 0;
int sqlParamIndex = begin;
- int settableIndex = 0;
+ int loc = 0;
for (int i = 0; i < propertySpan; i++)
{
int len = propertyTypes[i].GetColumnSpan(session.Factory);
@@ -305,23 +304,20 @@ public override void NullSafeSet(IDbCommand st, object value, int begin, bool[]
}
else if (len == 1)
{
- if (settable[settableIndex])
+ if (settable[loc])
{
propertyTypes[i].NullSafeSet(st, subvalues[i], sqlParamIndex, session);
sqlParamIndex++;
}
- settableIndex++;
}
else
{
bool[] subsettable = new bool[len];
- Array.Copy(settable, subvaluesIndex, subsettable, 0, len);
+ Array.Copy(settable, loc, subsettable, 0, len);
propertyTypes[i].NullSafeSet(st, subvalues[i], sqlParamIndex, subsettable, session);
- int subsettableCount = ArrayHelper.CountTrue(subsettable);
- sqlParamIndex += subsettableCount;
- settableIndex += subsettableCount;
+ sqlParamIndex += ArrayHelper.CountTrue(subsettable);
}
- subvaluesIndex += len;
+ loc += len;
}
}

0 comments on commit 9a26795

Please sign in to comment.