From b48cbf6e0aa8e89f0614c6f2ffe0d065e892d1ef Mon Sep 17 00:00:00 2001 From: Alspb Date: Tue, 2 Jul 2024 07:43:48 +0100 Subject: [PATCH] root.toDelta check replaced with assertion --- lib/src/models/documents/document.dart | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/src/models/documents/document.dart b/lib/src/models/documents/document.dart index 99a72e7a..6043b6f9 100644 --- a/lib/src/models/documents/document.dart +++ b/lib/src/models/documents/document.dart @@ -334,10 +334,7 @@ class Document { } catch (e) { throw StateError('_delta compose failed'); } - - if (_delta != _root.toDelta()) { - throw StateError('Compose failed'); - } + assert(_delta == _root.toDelta(), 'Compose failed'); final change = DocChange(originalDelta, delta, changeSource); documentChangeObserver.add(change); history.handleDocChange(change); @@ -422,7 +419,6 @@ class Document { doc.toString(), 'Document Delta cannot be empty.'); } - // print(doc.last.data.runtimeType); assert((doc.last.data as String).endsWith('\n')); var offset = 0;