internal static object CallWorker(CodeContext /*!*/ context, PythonType dt, IDictionary <string, object> kwArgs, object[] args) { object[] allArgs = ArrayOps.CopyArray(args, kwArgs.Count + args.Length); string[] argNames = new string[kwArgs.Count]; int i = args.Length; foreach (KeyValuePair <string, object> kvp in kwArgs) { allArgs[i] = kvp.Value; argNames[i++ - args.Length] = kvp.Key; } return(CallWorker(context, dt, new KwCallInfo(allArgs, argNames))); }
/// <summary> /// Multiply two object[] arrays - internal version used for objects backed by arrays /// </summary> internal static object[] Multiply(object[] data, int size, int count) { int newCount = checked (size * count); object[] ret = ArrayOps.CopyArray(data, newCount); if (count > 0) { // this should be extremely fast for large count as it uses the same algoithim as efficient integer powers // ??? need to test to see how large count and n need to be for this to be fastest approach int block = size; int pos = size; while (pos < newCount) { Array.Copy(ret, 0, ret, pos, Math.Min(block, newCount - pos)); pos += block; block *= 2; } } return(ret); }
/// <summary> /// Add two arrays - internal versions for objects backed by arrays /// </summary> /// <param name="data1"></param> /// <param name="size1"></param> /// <param name="data2"></param> /// <param name="size2"></param> /// <returns></returns> internal static object[] Add(object[] data1, int size1, object[] data2, int size2) { object[] ret = ArrayOps.CopyArray(data1, size1 + size2); Array.Copy(data2, 0, ret, size1, size2); return(ret); }