summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-13 01:31:27 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-13 01:31:27 +0000
commit0dc6dcfb6a3ecc25ac673c728645ab98925b8411 (patch)
tree64920e2c0280dab2a9845802a08ff8e612fdff8f
parent793c5ae865ce1d426506593d9ed627838de8e107 (diff)
* hash.c: Hash[] and {} are not equivalent by @eam [Fixes GH-301]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--hash.c13
2 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index f7b1f100ad..5a1905732a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon May 13 10:30:04 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * hash.c: Hash[] and {} are not equivalent by @eam [Fixes GH-301]
+
Mon May 13 10:04:22 2013 Zachary Scott <zachary@zacharyscott.net>
* random.c: Document Random::DEFAULT by @eLobato [Fixes GH-304]
diff --git a/hash.c b/hash.c
index 43b6757f14..2cb570505c 100644
--- a/hash.c
+++ b/hash.c
@@ -375,11 +375,14 @@ rb_hash_initialize(int argc, VALUE *argv, VALUE hash)
* Hash[ [ [key, value], ... ] ] -> new_hash
* Hash[ object ] -> new_hash
*
- * Creates a new hash populated with the given objects. Equivalent to
- * the literal <code>{ <i>key</i> => <i>value</i>, ... }</code>. In the first
- * form, keys and values occur in pairs, so there must be an even number of arguments.
- * The second and third form take a single argument which is either
- * an array of key-value pairs or an object convertible to a hash.
+ * Creates a new hash populated with the given objects.
+ *
+ * Similar to the literal <code>{ _key_ => _value_, ... }</code>. In the first
+ * form, keys and values occur in pairs, so there must be an even number of
+ * arguments.
+ *
+ * The second and third form take a single argument which is either an array
+ * of key-value pairs or an object convertible to a hash.
*
* Hash["a", 100, "b", 200] #=> {"a"=>100, "b"=>200}
* Hash[ [ ["a", 100], ["b", 200] ] ] #=> {"a"=>100, "b"=>200}