Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor split_at/split_to #663

Merged
merged 8 commits into from
Feb 23, 2024

Commits on Jan 21, 2024

  1. Configuration menu
    Copy the full SHA
    ea9dd60 View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2024

  1. inline set_end

    braddunbar committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    77a6f1c View commit details
    Browse the repository at this point in the history
  2. remove kind assertions

    The shallow clone call just above always results in the kind being
    shared so we don't need to assert it here.
    braddunbar committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    9bdf5eb View commit details
    Browse the repository at this point in the history
  3. remove duplicate assertion

    we already assert this at the top of the method
    braddunbar committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    00a60eb View commit details
    Browse the repository at this point in the history
  4. remove redundant assertion and min

    We know several things here:
    
    1. self.len <= self.cap, always
    2. at <= self.len, asserted at the top of this method
    3. after calling shallow_clone, other.cap == self.cap
    
    Therefore, at <= self.len <= other.cap.
    braddunbar committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    00f2b20 View commit details
    Browse the repository at this point in the history
  5. rename set_start to advance_unchecked

    This method never moves the cursor backward, only advances it forwards.
    I think reflecting that in the name makes things a bit more clear.
    
    I also added explicit safety comments to make it clear why each usage is
    sound.
    braddunbar committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    442f85d View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2024

  1. Configuration menu
    Copy the full SHA
    037dbe1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b971743 View commit details
    Browse the repository at this point in the history