diff --git a/core/lib/Drupal/Core/Routing/MatcherDumper.php b/core/lib/Drupal/Core/Routing/MatcherDumper.php
index 72c0bee..69dcda7 100644
--- a/core/lib/Drupal/Core/Routing/MatcherDumper.php
+++ b/core/lib/Drupal/Core/Routing/MatcherDumper.php
@@ -18,11 +18,6 @@
 class MatcherDumper implements MatcherDumperInterface {
 
   /**
-   * The maximum number of path elements for a route pattern;
-   */
-  const MAX_PARTS = 9;
-
-  /**
    * The database connection to which to dump route information.
    *
    * @var \Drupal\Core\Database\Connection
diff --git a/core/lib/Drupal/Core/Routing/RouteProvider.php b/core/lib/Drupal/Core/Routing/RouteProvider.php
index 9c660e8..419cc75 100644
--- a/core/lib/Drupal/Core/Routing/RouteProvider.php
+++ b/core/lib/Drupal/Core/Routing/RouteProvider.php
@@ -181,7 +181,7 @@ public function getRoutesByNames($names, $parameters = array()) {
   public function getCandidateOutlines(array $parts) {
     $number_parts = count($parts);
     $ancestors = array();
-    $length =  $number_parts - 1;
+    $length = $number_parts - 1;
     $end = (1 << $number_parts) - 1;
 
     // The highest possible mask is a 1 bit for every part of the path. We will
@@ -240,9 +240,9 @@ public function getRoutesByPattern($pattern) {
   protected function getRoutesByPath($path) {
     // Filter out each empty value, though allow '0' and 0, which would be
     // filtered out by empty().
-    $parts = array_slice(array_filter(explode('/', $path), function($value) {
+    $parts = array_values(array_filter(explode('/', $path), function($value) {
       return $value !== NULL && $value !== '';
-    }), 0, MatcherDumper::MAX_PARTS);
+    }));
 
     $ancestors = $this->getCandidateOutlines($parts);
 
