System.Data.SQLite
Check-in [0ebe466b2a]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Coding style enhancements.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | delegateFunction
Files: files | file ages | folders
SHA1: 0ebe466b2a9c49e7724a99a73f953de3f6b5a41b
User & Date: mistachkin 2015-08-05 00:55:59
Context
2015-08-05
00:57
Work in progress on tests. Not yet working. check-in: 56469328f7 user: mistachkin tags: delegateFunction
00:55
Coding style enhancements. check-in: 0ebe466b2a user: mistachkin tags: delegateFunction
2015-08-04
22:54
Experimental changes to support implementing a SQLiteFunction using a generic delegate. check-in: d1cfa62cb0 user: mistachkin tags: delegateFunction
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/SQLiteFunction.cs.

  1160   1160         protected virtual object[] GetInvokeArgs(
  1161   1161             object[] args
  1162   1162             ) /* CANNOT RETURN NULL */
  1163   1163         {
  1164   1164             if (args == null)
  1165   1165                 return new object[] { "Invoke" };
  1166   1166   
  1167         -          object[] newArgs = new object[args.Length + 1];
         1167  +          int length = args.Length;
         1168  +          object[] newArgs = new object[length + 1];
  1168   1169   
  1169   1170             newArgs[0] = "Invoke";
  1170   1171   
  1171         -          for (int index = 0; index < args.Length; index++)
         1172  +          for (int index = 0; index < length; index++)
  1172   1173                 newArgs[index + 1] = args[index];
  1173   1174   
  1174   1175             return newArgs;
  1175   1176         }
  1176   1177   
  1177   1178         /////////////////////////////////////////////////////////////////////////
  1178   1179   
................................................................................
  1197   1198         /// </returns>
  1198   1199         protected virtual object[] GetStepArgs(
  1199   1200             object[] args,
  1200   1201             int stepNumber,
  1201   1202             object contextData
  1202   1203             ) /* CANNOT RETURN NULL */
  1203   1204         {
  1204         -          int newLength = 3; /* "Step", stepNumber, contextData */
         1205  +          int length = 0;
  1205   1206   
  1206   1207             if (args != null)
  1207         -              newLength += args.Length;
         1208  +              length = args.Length;
  1208   1209   
         1210  +          int newLength = length + 3; /* "Step", stepNumber, contextData */
  1209   1211             object[] newArgs = new object[newLength];
  1210   1212   
  1211   1213             newArgs[0] = "Step";
  1212   1214   
  1213   1215             if (args != null)
  1214         -              for (int index = 0; index < args.Length; index++)
         1216  +              for (int index = 0; index < length; index++)
  1215   1217                     newArgs[index + 1] = args[index];
  1216   1218   
  1217   1219             newArgs[newLength - 2] = stepNumber;
  1218   1220             newArgs[newLength - 1] = contextData;
  1219   1221   
  1220   1222             return newArgs;
  1221   1223         }