Use foreach instead of a loop
This syntax makes plain that the function is not used anywhere else, and increases linearity/readability. // FREEBIE
This commit is contained in:
parent
acaf7b8de2
commit
6547538458
2 changed files with 4 additions and 10 deletions
|
@ -39891,7 +39891,7 @@ window.textsecure.messaging = function() {
|
|||
});
|
||||
};
|
||||
|
||||
var getDevicesAndSendToNumber = function(number) {
|
||||
numbers.forEach(function(number) {
|
||||
textsecure.storage.devices.getDeviceObjectsForNumber(number).then(function(devicesForNumber) {
|
||||
return Promise.all(devicesForNumber.map(function(device) {
|
||||
return textsecure.protocol_wrapper.hasOpenSession(device.encodedNumber).then(function(result) {
|
||||
|
@ -39911,10 +39911,7 @@ window.textsecure.messaging = function() {
|
|||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
for (var i in numbers)
|
||||
getDevicesAndSendToNumber(numbers[i]);
|
||||
});
|
||||
}
|
||||
|
||||
var sendIndividualProto = function(number, proto, timestamp) {
|
||||
|
|
|
@ -210,7 +210,7 @@ window.textsecure.messaging = function() {
|
|||
});
|
||||
};
|
||||
|
||||
var getDevicesAndSendToNumber = function(number) {
|
||||
numbers.forEach(function(number) {
|
||||
textsecure.storage.devices.getDeviceObjectsForNumber(number).then(function(devicesForNumber) {
|
||||
return Promise.all(devicesForNumber.map(function(device) {
|
||||
return textsecure.protocol_wrapper.hasOpenSession(device.encodedNumber).then(function(result) {
|
||||
|
@ -230,10 +230,7 @@ window.textsecure.messaging = function() {
|
|||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
for (var i in numbers)
|
||||
getDevicesAndSendToNumber(numbers[i]);
|
||||
});
|
||||
}
|
||||
|
||||
var sendIndividualProto = function(number, proto, timestamp) {
|
||||
|
|
Loading…
Reference in a new issue