Skip to content

Instantly share code, notes, and snippets.

@zzak
Created February 23, 2013 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zzak/5018073 to your computer and use it in GitHub Desktop.
Save zzak/5018073 to your computer and use it in GitHub Desktop.
Array#&, #|, #- return order
Index: array.c
===================================================================
--- array.c (revision 39413)
+++ array.c (working copy)
@@ -3801,7 +3801,8 @@
* Array Difference
*
* Returns a new array that is a copy of the original array, removing any
- * items that also appear in +other_ary+.
+ * items that also appear in +other_ary+. The order is preserved from the
+ * original array.
*
* It compares elements using their #hash and #eql? methods for efficiency.
*
@@ -3833,7 +3834,8 @@
* ary & other_ary -> new_ary
*
* Set Intersection --- Returns a new array containing elements common to the
- * two arrays, excluding any duplicates.
+ * two arrays, excluding any duplicates. The order is preserved from the
+ * original array.
*
* It compares elements using their #hash and #eql? methods for efficiency.
*
@@ -3875,7 +3877,7 @@
* ary | other_ary -> new_ary
*
* Set Union --- Returns a new array by joining +ary+ with +other_ary+,
- * excluding any duplicates.
+ * excluding any duplicates and preserving the order from the original array.
*
* It compares elements using their #hash and #eql? methods for efficiency.
*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment