mirror of
https://github.com/loro-dev/loro.git
synced 2025-02-06 12:25:03 +00:00
fix: avoid zero len del in text
This commit is contained in:
parent
63cd719393
commit
b8056614f5
1 changed files with 4 additions and 0 deletions
|
@ -79,6 +79,10 @@ impl TextContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn delete(&mut self, txn: &mut Transaction, pos: usize, len: usize) {
|
pub(crate) fn delete(&mut self, txn: &mut Transaction, pos: usize, len: usize) {
|
||||||
|
if len == 0 {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
self.state.delete_range(Some(pos), Some(pos + len));
|
self.state.delete_range(Some(pos), Some(pos + len));
|
||||||
txn.with_store_hierarchy_mut(|txn, store, hierarchy| {
|
txn.with_store_hierarchy_mut(|txn, store, hierarchy| {
|
||||||
let id = store.next_id();
|
let id = store.next_id();
|
||||||
|
|
Loading…
Reference in a new issue