diff --git a/core/lib/Drupal/Core/DependencyInjection/Compiler/MimeTypePass.php b/core/lib/Drupal/Core/DependencyInjection/Compiler/MimeTypePass.php
index f20edc0956..87294d933a 100644
--- a/core/lib/Drupal/Core/DependencyInjection/Compiler/MimeTypePass.php
+++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/MimeTypePass.php
@@ -55,16 +55,7 @@ public function process(ContainerBuilder $container) {
     // Add a method call for each handler to the consumer service
     // definition.
     foreach ($handlers as $id => $priority) {
-      $arguments = [];
-      $arguments[0] = new Reference($id);
-      if (isset($priority_pos)) {
-        $arguments[$priority_pos] = $priority;
-      }
-      if (isset($id_pos)) {
-        $arguments[$id_pos] = $id;
-      }
-      // Sort the arguments by position.
-      ksort($arguments);
+      $arguments = [new Reference($id), $priority];
       if (is_subclass_of($interfaces[$id], $interface)) {
         $consumer->addMethodCall('addMimeTypeGuesser', $arguments);
       }
