You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
chore: remove let due to performance reasons
This commit is contained in:
@@ -16,7 +16,7 @@ class AbortError extends RedisError {
|
||||
if (stack || stack === undefined) {
|
||||
Error.captureStackTrace(this, AbortError)
|
||||
}
|
||||
for (let keys = Object.keys(obj), key = keys.pop(); key; key = keys.pop()) {
|
||||
for (var keys = Object.keys(obj), key = keys.pop(); key; key = keys.pop()) {
|
||||
this[key] = obj[key]
|
||||
}
|
||||
}
|
||||
|
@@ -117,7 +117,7 @@ function infoCallback (self) {
|
||||
const lines = res.toString().split('\r\n')
|
||||
var line, parts, subParts
|
||||
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
for (var i = 0; i < lines.length; i++) {
|
||||
parts = lines[i].split(':')
|
||||
if (parts[1]) {
|
||||
if (parts[0].indexOf('db') === 0) {
|
||||
|
@@ -90,7 +90,7 @@ function execTransaction (multi) {
|
||||
// Silently ignore this error. We'll receive the error for the exec as well
|
||||
const promises = [multi._client.internalSendCommand(new Command('multi', [])).catch(() => {})]
|
||||
// Drain queue, callback will catch 'QUEUED' or error
|
||||
for (let index = 0; index < len; index++) {
|
||||
for (var index = 0; index < len; index++) {
|
||||
// The commands may not be shifted off, since they are needed in the result handler
|
||||
promises.push(pipelineTransactionCommand(multi, multi._queue.get(index), index).catch((e) => e))
|
||||
}
|
||||
@@ -156,7 +156,7 @@ class Multi {
|
||||
// Either undefined or an array. Fail hard if it's not an array
|
||||
if (args) {
|
||||
// Legacy support for passing in an array of arguments
|
||||
for (let i = 0; i < args.length; i++) {
|
||||
for (var i = 0; i < args.length; i++) {
|
||||
const command = args[i][0]
|
||||
const tmpArgs = args[i].slice(1)
|
||||
if (Array.isArray(command)) {
|
||||
|
@@ -62,7 +62,7 @@ function clone (obj) {
|
||||
var copy
|
||||
if (Array.isArray(obj)) {
|
||||
copy = new Array(obj.length)
|
||||
for (let i = 0; i < obj.length; i++) {
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
copy[i] = clone(obj[i])
|
||||
}
|
||||
return copy
|
||||
@@ -70,7 +70,7 @@ function clone (obj) {
|
||||
if (Object.prototype.toString.call(obj) === '[object Object]') {
|
||||
copy = {}
|
||||
const elements = Object.keys(obj)
|
||||
for (let elem = elements.pop(); elem !== undefined; elem = elements.pop()) {
|
||||
for (var elem = elements.pop(); elem !== undefined; elem = elements.pop()) {
|
||||
copy[elem] = clone(obj[elem])
|
||||
}
|
||||
return copy
|
||||
|
Reference in New Issue
Block a user