Org.Mozilla.Classfile.ClassFileWriter.FinalizeSuperBlockStarts C# (CSharp) Method

FinalizeSuperBlockStarts() private method

Sort the list of recorded super block starts and remove duplicates.
Sort the list of recorded super block starts and remove duplicates. Also adds exception handling blocks as block starts, since there is no explicit control flow to these. Used for stack map table generation.
private FinalizeSuperBlockStarts ( ) : void
return void
		private void FinalizeSuperBlockStarts()
		{
			if (GenerateStackMap)
			{
				for (int i = 0; i < itsExceptionTableTop; i++)
				{
					ExceptionTableEntry ete = itsExceptionTable[i];
					short handlerPC = (short)GetLabelPC(ete.itsHandlerLabel);
					AddSuperBlockStart(handlerPC);
				}
				Arrays.Sort(itsSuperBlockStarts, 0, itsSuperBlockStartsTop);
				int prev = itsSuperBlockStarts[0];
				int copyTo = 1;
				for (int i_1 = 1; i_1 < itsSuperBlockStartsTop; i_1++)
				{
					int curr = itsSuperBlockStarts[i_1];
					if (prev != curr)
					{
						if (copyTo != i_1)
						{
							itsSuperBlockStarts[copyTo] = curr;
						}
						copyTo++;
						prev = curr;
					}
				}
				itsSuperBlockStartsTop = copyTo;
				if (itsSuperBlockStarts[copyTo - 1] == itsCodeBufferTop)
				{
					itsSuperBlockStartsTop--;
				}
			}
		}