diff --git a/core/lib/Drupal/Component/Utility/Html.php b/core/lib/Drupal/Component/Utility/Html.php
index d4bf13e..5d24e4f 100644
--- a/core/lib/Drupal/Component/Utility/Html.php
+++ b/core/lib/Drupal/Component/Utility/Html.php
@@ -69,21 +69,25 @@ public static function getClass($class) {
    *
    * @param string $identifier
    *   The identifier to clean.
-   * @param array $filter
-   *   An array of string replacements to use on the identifier.
    *
    * @return string
    *   The cleaned identifier.
    */
-  public static function cleanCssIdentifier($identifier, array $filter = array(
-    ' ' => '-',
-    '_' => '-',
-    '__' => '__',
-    '/' => '-',
-    '[' => '-',
-    ']' => ''
-  )) {
-    $identifier = strtr($identifier, $filter);
+  public static function cleanCssIdentifier($identifier) {
+    $filter = [
+      ' ' => '-',
+      '_' => '-',
+      '/' => '-',
+      '[' => '-',
+      ']' => ''
+    ];
+    // We could also use strtr() here but its much slower than str_replace(). In
+    // order to keep '__' to stay '__' we first replace it with a different
+    // placeholder.
+    $identifier = str_replace('__', '##', $identifier);
+    $identifier = str_replace(array_keys($filter), array_values($filter), $identifier);
+    $identifier = str_replace('##', '__', $identifier);
+
     // Valid characters in a CSS identifier are:
     // - the hyphen (U+002D)
     // - a-z (U+0030 - U+0039)
