{
// Create an array of delegate copies and each
// element into the array
- int invocationCount = (int)_invocationCount;
- del = new Delegate[invocationCount];
+ del = new Delegate[(int)_invocationCount];
- for (int i = 0; i < invocationCount; i++)
+ for (int i = 0; i < del.Length; i++)
del[i] = (Delegate)invocationList[i];
}
return del;
{
Module[] m = GetModules(false);
- int iNumModules = m.Length;
int iFinalLength = 0;
- Type[][] ModuleTypes = new Type[iNumModules][];
+ Type[][] ModuleTypes = new Type[m.Length][];
- for (int i = 0; i < iNumModules; i++)
+ for (int i = 0; i < ModuleTypes.Length; i++)
{
ModuleTypes[i] = m[i].GetTypes();
iFinalLength += ModuleTypes[i].Length;
int iCurrent = 0;
Type[] ret = new Type[iFinalLength];
- for (int i = 0; i < iNumModules; i++)
+ for (int i = 0; i < ModuleTypes.Length; i++)
{
int iLength = ModuleTypes[i].Length;
Array.Copy(ModuleTypes[i], 0, ret, iCurrent, iLength);
public override FileStream[] GetFiles(bool getResourceModules)
{
Module[] m = GetModules(getResourceModules);
- int iLength = m.Length;
- FileStream[] fs = new FileStream[iLength];
+ FileStream[] fs = new FileStream[m.Length];
- for(int i = 0; i < iLength; i++)
+ for (int i = 0; i < fs.Length; i++)
+ {
fs[i] = new FileStream(((RuntimeModule)m[i]).GetFullyQualifiedName(),
FileMode.Open,
FileAccess.Read, FileShare.Read, FileStream.DefaultBufferSize, false);
+ }
return fs;
}
Type[] parameterTypes,
Type[] optionalParameterTypes)
{
- int cParams;
- int i;
- SignatureHelper sig;
- if (parameterTypes == null)
- cParams = 0;
- else
- cParams = parameterTypes.Length;
- sig = SignatureHelper.GetMethodSigHelper(call, returnType);
- for (i = 0; i < cParams; i++)
- sig.AddArgument(parameterTypes[i]);
+ SignatureHelper sig = SignatureHelper.GetMethodSigHelper(call, returnType);
+ if (parameterTypes != null)
+ {
+ foreach (Type t in parameterTypes)
+ sig.AddArgument(t);
+ }
if (optionalParameterTypes != null && optionalParameterTypes.Length != 0)
{
// add the sentinel
sig.AddSentinel();
- for (i = 0; i < optionalParameterTypes.Length; i++)
- sig.AddArgument(optionalParameterTypes[i]);
+ foreach (Type t in optionalParameterTypes)
+ sig.AddArgument(t);
}
return sig;
}
// Just a cheap insertion sort. We don't expect many exceptions (<10), where InsertionSort beats QuickSort.
// If we have more exceptions than this in real life, we should consider moving to a QuickSort.
- int least;
- __ExceptionInfo temp;
- int length = exceptions.Length;
- for (int i =0; i < length; i++)
+ for (int i = 0; i < exceptions.Length; i++)
{
- least = i;
- for (int j =i + 1; j < length; j++)
+ int least = i;
+ for (int j = i + 1; j < exceptions.Length; j++)
{
if (exceptions[least].IsInner(exceptions[j]))
{
least = j;
}
}
- temp = exceptions[i];
+ __ExceptionInfo temp = exceptions[i];
exceptions[i] = exceptions[least];
exceptions[least] = temp;
}
if (parameters == null)
throw new ArgumentException(Environment.GetResourceString("Argument_InvalidConstructorInfo"));
- int count = parameters.Length;
- Type[] parameterTypes = new Type[count];
- Type[][] requiredCustomModifiers = new Type[count][];
- Type[][] optionalCustomModifiers = new Type[count][];
+ Type[] parameterTypes = new Type[parameters.Length];
+ Type[][] requiredCustomModifiers = new Type[parameters.Length][];
+ Type[][] optionalCustomModifiers = new Type[parameters.Length][];
- for (int i = 0; i < count; i++)
+ for (int i = 0; i < parameters.Length; i++)
{
if (parameters[i] == null)
throw new ArgumentException(Environment.GetResourceString("Argument_InvalidConstructorInfo"));
internal SignatureHelper GetMemberRefSignature(CallingConventions call, Type returnType,
Type[] parameterTypes, IEnumerable<Type> optionalParameterTypes, int cGenericParameters)
{
- int cParams = (parameterTypes == null) ? 0 : parameterTypes.Length;
SignatureHelper sig = SignatureHelper.GetMethodSigHelper(this, call, returnType, cGenericParameters);
- for (int i = 0; i < cParams; i++)
+ if (parameterTypes != null)
{
- sig.AddArgument(parameterTypes[i]);
+ foreach (Type t in parameterTypes)
+ {
+ sig.AddArgument(t);
+ }
}
if (optionalParameterTypes != null) {
return null;
char[] c = new char[length];
- for (int i = 0; i < length; i ++)
+ for (int i = 0; i < c.Length; i ++)
{
#if ALIGN_ACCESS
c[i] = (char)Marshal.ReadInt16( (IntPtr) (((char*)name) + i) );
// Reallocate both buckets and entries and rebuild the bucket and entries from scratch.
// This serves both to scrub entries with expired keys and to put the new entries in the proper bucket.
int[] newBuckets = new int[newSize];
- for (int bucketIndex = 0; bucketIndex < newSize; bucketIndex++)
+ for (int bucketIndex = 0; bucketIndex < newBuckets.Length; bucketIndex++)
{
newBuckets[bucketIndex] = -1;
}