mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
delegates: perf increase
This commit is contained in:
@@ -65,9 +65,10 @@ function delegateService(methodNames) {
|
||||
function callMethod(instancesToUse, methodName, args) {
|
||||
var finalResult;
|
||||
var result;
|
||||
instancesToUse.forEach(function(instance) {
|
||||
instancesToUse.forEach(function(instance, index) {
|
||||
result = instance[methodName].apply(instance, args);
|
||||
if (!angular.isDefined(finalResult)) {
|
||||
//Make it so the first result is the one returned
|
||||
if (index === 0) {
|
||||
finalResult = result;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user