From 0790074cf36dbe21b3b78fc9f3b968e6e2a8e8d1 Mon Sep 17 00:00:00 2001 From: Klaus Hartl Date: Wed, 18 Aug 2021 08:16:27 +0200 Subject: [PATCH] Remove unnecessary assignment Reduces size a little further.. --- src/api.mjs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/api.mjs b/src/api.mjs index acc92ae1..8e192137 100644 --- a/src/api.mjs +++ b/src/api.mjs @@ -21,8 +21,6 @@ function init (converter, defaultAttributes) { .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent) .replace(/[()]/g, escape) - value = converter.write(value, key) - var stringifiedAttributes = '' for (var attributeName in attributes) { if (!attributes[attributeName]) { @@ -45,7 +43,8 @@ function init (converter, defaultAttributes) { stringifiedAttributes += '=' + attributes[attributeName].split(';')[0] } - return (document.cookie = key + '=' + value + stringifiedAttributes) + return (document.cookie = + key + '=' + converter.write(value, key) + stringifiedAttributes) } function get (key) {