Category talk:Wren-llist: Difference between revisions
Content added Content deleted
(→Source code: Added copy() methods.) |
m (→Source code: Minor change to exchange() methods.) |
||
Line 273: | Line 273: | ||
// Exchanges the elements at indices 'i' and 'j' of the current instance. |
// Exchanges the elements at indices 'i' and 'j' of the current instance. |
||
exchange(i, j) { |
exchange(i, j) { |
||
if (i == j) return |
|||
var t = this[i] |
var t = this[i] |
||
this[i] = this[j] |
this[i] = this[j] |
||
Line 734: | Line 735: | ||
// Exchanges the elements at indices 'i' and 'j' of the current instance. |
// Exchanges the elements at indices 'i' and 'j' of the current instance. |
||
exchange(i, j) { |
exchange(i, j) { |
||
if (i == j) return |
|||
var t = this[i] |
var t = this[i] |
||
this[i] = this[j] |
this[i] = this[j] |