@@ -314,8 +314,10 @@ impl ChangeSet {
314 /// `true` when the set is empty.
314 /// `true` when the set is empty.
315 #[inline]
315 #[inline]
316 pub fn is_empty(&self) -> bool {
316 pub fn is_empty(&self) -> bool {
317− let len = self.changes.len();
317+ match self.changes.as_slice() {
318− len == 0 || (len == 1 && self.changes[0] == Operation::Retain(self.len))
318+ [] | [Operation::Retain(_)] => true,
321 /// Map a position through the changes.
323 /// Map a position through the changes.