From e23354b2bb7f268048b571586967ebcdcc1774e4 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Sat, 24 Jun 2017 12:09:52 +0100 Subject: [PATCH] tidy up split node to remove todo comments --- nodes/core/logic/17-split.js | 12 +----------- test/nodes/core/logic/17-split_spec.js | 1 - 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/nodes/core/logic/17-split.js b/nodes/core/logic/17-split.js index 31809941c..5a913feaf 100644 --- a/nodes/core/logic/17-split.js +++ b/nodes/core/logic/17-split.js @@ -80,8 +80,6 @@ module.exports = function(RED) { msg.parts.ch = ""; var count = msg.payload.length/node.splt; if (Math.floor(count) !== count) { - // Partial last packet - //TODO stream support count = Math.ceil(count); } if (node.stream !== true) { @@ -123,8 +121,6 @@ module.exports = function(RED) { msg.parts.type = "array"; var count = msg.payload.length/node.arraySplt; if (Math.floor(count) !== count) { - // Partial last packet - //TODO stream support count = Math.ceil(count); } msg.parts.count = count; @@ -165,8 +161,6 @@ module.exports = function(RED) { if (node.spltType === "len") { var count = buff.length/node.splt; if (Math.floor(count) !== count) { - // Partial last packet - //TODO stream support count = Math.ceil(count); } if (node.stream !== true) { @@ -203,10 +197,7 @@ module.exports = function(RED) { end = pos+node.splt.length; pos = buff.indexOf(node.splt,end); } - //TODO: stream support - // if (end < msg.payload.length) { - count++; - // } + count++; if (node.stream !== true) { msg.parts.count = count; node.c = 0; @@ -222,7 +213,6 @@ module.exports = function(RED) { pos = buff.indexOf(node.splt,p); } if ((node.stream !== true) && (p < buff.length)) { - // TODO: stream support; msg.payload = buff.slice(p,buff.length); msg.parts.index = node.c++; msg.parts.count = node.c++; diff --git a/test/nodes/core/logic/17-split_spec.js b/test/nodes/core/logic/17-split_spec.js index 49615fccc..4d6602aa4 100644 --- a/test/nodes/core/logic/17-split_spec.js +++ b/test/nodes/core/logic/17-split_spec.js @@ -627,5 +627,4 @@ describe('JOIN node', function() { }); }) - });