Skip to content
This repository has been archived by the owner on Dec 6, 2017. It is now read-only.

Commit

Permalink
perf(resolvedTypes): minor performance inmprovement in resolvedTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelgj committed Apr 16, 2014
1 parent dbc1277 commit ba16bde
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/injector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,21 @@ abstract class Injector implements ObjectFactory {
// as an array, but there may be a better solution.
static const ZERO_DEPTH_RESOLVING = const [0];

static Iterable<Key> resolvedTypes(resolving) {
static List<Key> resolvedTypes(resolving) {
List resolved = [];
while (resolving[0] != 0) {
resolved.add(resolving[1]);
resolving = resolving[2];
}
return resolved.reversed;
return resolved;
}

static String error(List resolving, message, [appendDependency]) {
if (appendDependency != null) {
resolving = [resolving[0] + 1, appendDependency, resolving];
}

String graph = resolvedTypes(resolving).join(' -> ');
String graph = resolvedTypes(resolving).reversed.join(' -> ');

return '$message (resolving $graph)';
}
Expand Down

0 comments on commit ba16bde

Please sign in to comment.