Mono.Cecil.Cil.InstructionCollection.OnInsert C# (CSharp) Method

OnInsert() protected method

protected OnInsert ( item, int index ) : void
index int
return void
		protected override void OnInsert (Instruction item, int index)
		{
			if (size == 0)
				return;

			var current = items [index];
			if (current == null) {
				var last = items [index - 1];
				last.next = item;
				item.previous = last;
				return;
			}

			var previous = current.previous;
			if (previous != null) {
				previous.next = item;
				item.previous = previous;
			}

			current.previous = item;
			item.next = current;
		}