Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1091
diff -u -p -r1.1091 common.inc
--- includes/common.inc	18 Jan 2010 03:28:13 -0000	1.1091
+++ includes/common.inc	21 Jan 2010 18:17:00 -0000
@@ -3567,11 +3567,15 @@ function drupal_clean_css_identifier($id
  *
  * @param $class
  *   The class name to clean.
+ * @param $underscores_only
+ *   If $class is known to only contain ASCII characters in the set 'a-z0-9_'
+ *   (i.e., lowercase letters, numbers, and underscore), then setting this to
+ *   TRUE results in faster execution.
  * @return
  *   The cleaned class name.
  */
-function drupal_html_class($class) {
-  return drupal_clean_css_identifier(drupal_strtolower($class));
+function drupal_html_class($class, $underscores_only = FALSE) {
+  return $underscores_only ? strtr($class, '_', '-') : drupal_clean_css_identifier(drupal_strtolower($class));
 }
 
 /**
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.569
diff -u -p -r1.569 theme.inc
--- includes/theme.inc	13 Jan 2010 05:40:03 -0000	1.569
+++ includes/theme.inc	21 Jan 2010 18:17:01 -0000
@@ -2183,7 +2183,7 @@ function template_preprocess(&$variables
   $variables['directory'] = path_to_theme();
 
   // Initialize html class attribute for the current hook.
-  $variables['classes_array'] = array(drupal_html_class($hook));
+  $variables['classes_array'] = array(drupal_html_class($hook, TRUE));
 
   // Merge in variables that don't depend on hook and don't change during a
   // single page request.
