internal Rope(RopeNode <T> root) { this.root = root; root.CheckInvariants(); }
/// <summary> /// Creates a new rope representing the empty string. /// </summary> public Rope() { // we'll construct the empty rope as a clone of an imaginary static empty rope root = RopeNode <T> .emptyRopeNode; root.CheckInvariants(); }
/// <summary> /// Resets the rope to an empty list. /// Runs in O(1). /// </summary> public void Clear() { root = RopeNode <T> .emptyRopeNode; OnChanged(); }