[Pkg-javascript-commits] [node-sha.js] 173/237: sha*: avoid unnecessary var declaration separation

Bastien Roucariès rouca at moszumanska.debian.org
Fri May 5 09:03:51 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-sha.js.

commit d9850165dd29f662ff5c9490f9922a2bc65fec73
Author: Daniel Cousens <github at dcousens.com>
Date:   Mon Jan 12 19:09:34 2015 +1100

    sha*: avoid unnecessary var declaration separation
---
 sha1.js   | 13 ++++++-------
 sha256.js | 17 ++++++++---------
 sha512.js | 38 ++++++++++++++++++--------------------
 3 files changed, 32 insertions(+), 36 deletions(-)

diff --git a/sha1.js b/sha1.js
index 8ed76a9..9e3504c 100644
--- a/sha1.js
+++ b/sha1.js
@@ -12,7 +12,7 @@ var Hash = require('./hash')
 
 var W = new Array(80)
 
-function Sha1 () {
+function Sha1() {
   this.init()
   this._w = W
 
@@ -61,13 +61,12 @@ function rol(num, cnt) {
 
 Sha1.prototype._update = function (M) {
   var W = this._w
-  var a, b, c, d, e
 
-  a = this._a
-  b = this._b
-  c = this._c
-  d = this._d
-  e = this._e
+  var a = this._a
+  var b = this._b
+  var c = this._c
+  var d = this._d
+  var e = this._e
 
   for (var j = 0; j < 80; j++) {
     var w = W[j] = j < 16
diff --git a/sha256.js b/sha256.js
index 0e1efc6..0841dc8 100644
--- a/sha256.js
+++ b/sha256.js
@@ -87,17 +87,16 @@ function Gamma1256 (x) {
 
 Sha256.prototype._update = function(M) {
   var W = this._w
-  var a, b, c, d, e, f, g, h
   var T1, T2
 
-  a = this._a | 0
-  b = this._b | 0
-  c = this._c | 0
-  d = this._d | 0
-  e = this._e | 0
-  f = this._f | 0
-  g = this._g | 0
-  h = this._h | 0
+  var a = this._a | 0
+  var b = this._b | 0
+  var c = this._c | 0
+  var d = this._d | 0
+  var e = this._e | 0
+  var f = this._f | 0
+  var g = this._g | 0
+  var h = this._h | 0
 
   for (var j = 0; j < 64; j++) {
     var w = W[j] = j < 16
diff --git a/sha512.js b/sha512.js
index 24a68d4..e0eb901 100644
--- a/sha512.js
+++ b/sha512.js
@@ -91,26 +91,24 @@ function Maj (x, y, z) {
 
 Sha512.prototype._update = function(M) {
   var W = this._w
-  var a, b, c, d, e, f, g, h
-  var al, bl, cl, dl, el, fl, gl, hl
-
-  a = this._a | 0
-  b = this._b | 0
-  c = this._c | 0
-  d = this._d | 0
-  e = this._e | 0
-  f = this._f | 0
-  g = this._g | 0
-  h = this._h | 0
-
-  al = this._al | 0
-  bl = this._bl | 0
-  cl = this._cl | 0
-  dl = this._dl | 0
-  el = this._el | 0
-  fl = this._fl | 0
-  gl = this._gl | 0
-  hl = this._hl | 0
+
+  var a = this._a | 0
+  var b = this._b | 0
+  var c = this._c | 0
+  var d = this._d | 0
+  var e = this._e | 0
+  var f = this._f | 0
+  var g = this._g | 0
+  var h = this._h | 0
+
+  var al = this._al | 0
+  var bl = this._bl | 0
+  var cl = this._cl | 0
+  var dl = this._dl | 0
+  var el = this._el | 0
+  var fl = this._fl | 0
+  var gl = this._gl | 0
+  var hl = this._hl | 0
 
   for (var i = 0; i < 80; i++) {
     var j = i * 2

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-sha.js.git



More information about the Pkg-javascript-commits mailing list