From feae0d51bd04c78493f2d0afbf03dd93fb7bf533 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Wed, 20 Apr 2016 12:37:56 +0200 Subject: [PATCH] fixed content.length in tryExecute --- src/Database.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Database.js b/src/Database.js index a7a7a852..d8a37ea8 100644 --- a/src/Database.js +++ b/src/Database.js @@ -350,9 +350,8 @@ module.exports = function (Y /* :any */) { while (defined != null && defined.content != null) { // check if this op has a longer content in the case it is defined if (defined.content.length < op.content.length) { - var diff = op.content.length - defined.content.length - op.content.splice(0, diff) - op.id = [op.id[0], op.id[1] + diff] + op.content.splice(0, defined.content.length) + op.id = [op.id[0], op.id[1] + defined.content.length] op.left = defined.id op.origin = defined.id defined = yield* this.getOperation(op.id)