def _shrink_update(self, rmstart: int, rmstop: int) -> None:
<EOL>for spans in self._type_to_spans.values():<EOL><INDENT>i = len(spans) - <NUM_LIT:1><EOL>while i >= <NUM_LIT:0>:<EOL><INDENT>s, e = span = spans[i]<EOL>if rmstop <= s:<EOL><INDENT>rmlength = rmstop - rmstart<EOL>span[:] = s - rmlength, e - rmlength<EOL>i -= <NUM_LIT:1><EOL>continue<EOL><DEDENT>break<EOL><DEDENT>else:<EOL><INDENT>continue<EOL><DEDENT>while True:<EOL><INDENT>if rmstart <= s:<EOL><INDENT>if rmstop < e:<EOL><INDENT>span[:] = rmstart, e + rmstart - rmstop<EOL>i -= <NUM_LIT:1><EOL>if i < <NUM_LIT:0>:<EOL><INDENT>break<EOL><DEDENT>s, e = span = spans[i]<EOL>continue<EOL><DEDENT>spans.pop(i)[:] = -<NUM_LIT:1>, -<NUM_LIT:1><EOL>i -= <NUM_LIT:1><EOL>if i < <NUM_LIT:0>:<EOL><INDENT>break<EOL><DEDENT>s, e = span = spans[i]<EOL>continue<EOL><DEDENT>break<EOL><DEDENT>while i >= <NUM_LIT:0>:<EOL><INDENT>if e <= rmstart:<EOL><INDENT>i -= <NUM_LIT:1><EOL>if i < <NUM_LIT:0>:<EOL><INDENT>break<EOL><DEDENT>s, e = span = spans[i]<EOL>continue<EOL><DEDENT>span[<NUM_LIT:1>] -= rmstop - rmstart<EOL>i -= <NUM_LIT:1><EOL>if i < <NUM_LIT:0>:<EOL><INDENT>break<EOL><DEDENT>s, e = span = spans[i]<EOL>continue<EOL><DEDENT><DEDENT>
Update self._type_to_spans according to the removed span.

        Warning: If an operation involves both _shrink_update and
        _insert_update, you might wanna consider doing the
        _insert_update before the _shrink_update as this function
        can cause data loss in self._type_to_spans.