diff options
Diffstat (limited to 'lib/Rewrite/RewriteRope.cpp')
-rw-r--r-- | lib/Rewrite/RewriteRope.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Rewrite/RewriteRope.cpp b/lib/Rewrite/RewriteRope.cpp index 7ee9fcced2..9d5d7a7410 100644 --- a/lib/Rewrite/RewriteRope.cpp +++ b/lib/Rewrite/RewriteRope.cpp @@ -567,10 +567,12 @@ void RopePieceBTreeInterior::erase(unsigned Offset, unsigned NumBytes) { unsigned BytesFromChild = CurChild->size()-Offset; CurChild->erase(Offset, BytesFromChild); NumBytes -= BytesFromChild; + // Start at the beginning of the next child. + Offset = 0; ++i; continue; } - + // If the deletion request completely covers the child, delete it and move // the rest down. NumBytes -= CurChild->size(); |