Browse Source

Simplify ordering of links (there cannot be multiple links to the same target)

perprogramming 12 years ago
parent
commit
9219e1ab0a
1 changed files with 1 additions and 9 deletions
  1. 1 9
      src/Composer/Package/Dumper/ArrayDumper.php

+ 1 - 9
src/Composer/Package/Dumper/ArrayDumper.php

@@ -60,18 +60,10 @@ class ArrayDumper
 
         foreach (BasePackage::$supportedLinkTypes as $type => $opts) {
             if ($links = $package->{'get'.ucfirst($opts['method'])}()) {
-                usort($links, function (Link $a, Link $b) {
-                    $comparison = strcmp($a->getTarget(), $b->getTarget());
-
-                    if (0 !== $comparison) {
-                        return $comparison;
-                    }
-
-                    return strcmp($a->getPrettyConstraint(), $b->getPrettyConstraint());
-                });
                 foreach ($links as $link) {
                     $data[$type][$link->getTarget()] = $link->getPrettyConstraint();
                 }
+                ksort($data[$type]);
             }
         }