Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.740
diff -u -p -r1.740 comment.module
--- modules/comment/comment.module	10 Jul 2009 05:50:08 -0000	1.740
+++ modules/comment/comment.module	21 Jul 2009 12:56:46 -0000
@@ -1291,6 +1291,18 @@ function comment_load_multiple($cids = a
   if (!empty($comments)) {
     module_invoke_all('comment_load', $comments);
   }
+
+  // Ensure comments queried by cid are returned in the same order they were
+  // requested.
+  if ($cids) {
+    // Remove any invalid nids from the array.
+    $cids = array_intersect_key($cids, $comments);
+    foreach ($comments as $comment) {
+      $cids[$comment->cid] = $comment;
+    }
+    $comments = $cids;
+  }
+
   return $comments;
 }
