From 6b8a8664f8767df8d88ffe17f568051e319c8c51 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 6 Oct 2017 19:27:37 -0600 Subject: [PATCH] ws, remove cruft --- packer/type.ns.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/packer/type.ns.js b/packer/type.ns.js index 20a0ee1..70ca723 100644 --- a/packer/type.ns.js +++ b/packer/type.ns.js @@ -1,28 +1,24 @@ (function (exports) { 'use strict'; - // NS name for the supplied domain. May be label, pointer or any combination exports.DNS_PACKER_TYPE_NS = function (ab, dv, total, record) { - if(!record.data){ + if (!record.data) { throw new Error("no data on NS record"); } - - var nsLen = 0; var rdLenIndex = total; total +=2; - // RDATA + // RDATA // a sequence of labels - record.data.split('.').forEach(function(label) { - nsLen += 1 + label.length; - + record.data.split('.').forEach(function (label) { + dv.setUint8(total, label.length, false); total += 1; - label.split('').forEach(function (ch){ + label.split('').forEach(function (ch) { dv.setUint8(total, ch.charCodeAt(0), false); total += 1; }); @@ -31,7 +27,6 @@ exports.DNS_PACKER_TYPE_NS = function (ab, dv, total, record) { // RDLENGTH dv.setUint16(rdLenIndex, record.data.length + 1, false); - return total; };