Skip to content

Commit 59f0e73

Browse files
Oleg Andreyevkvz
Oleg Andreyev
authored andcommitted
locutusjs#344 fixing issue with delete keyword (locutusjs#346)
1 parent db25b54 commit 59f0e73

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/php/array/array_multisort.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = function array_multisort (arr) { // eslint-disable-line camelcase
22
// discuss at: http://locutus.io/php/array_multisort/
33
// original by: Theriault (https://github.com/Theriault)
4+
// improved by: Oleg Andreyev (https://github.com/oleg-andreyev)
45
// example 1: array_multisort([1, 2, 1, 2, 1, 2], [1, 2, 3, 4, 5, 6])
56
// returns 1: true
67
// example 2: var $characters = {A: 'Edward', B: 'Locke', C: 'Sabin', D: 'Terra', E: 'Edward'}
@@ -182,8 +183,8 @@ module.exports = function array_multisort (arr) { // eslint-disable-line camelca
182183
args[i][vkey] = sortArrs[i][j]
183184
}
184185
}
185-
delete sortArrs[i]
186-
delete sortKeys[i]
186+
sortArrs.splice(i, 1)
187+
sortKeys.splice(i, 1)
187188
continue
188189
}
189190

@@ -294,8 +295,8 @@ module.exports = function array_multisort (arr) { // eslint-disable-line camelca
294295
args[i][vkey] = sortArrs[i][j]
295296
}
296297
}
297-
delete sortArrs[i]
298-
delete sortKeys[i]
298+
sortArrs.splice(i, 1)
299+
sortKeys.splice(i, 1)
299300
}
300301
}
301302
return true

0 commit comments

Comments
 (0)