[前][次][番号順一覧][スレッド一覧]

ruby-changes:59386

From: Marcus <ko1@a...>
Date: Mon, 23 Dec 2019 06:46:59 +0900 (JST)
Subject: [ruby-changes:59386] bb05cdcd78 (master): [DOC] Improve documentation for Enumerable#tally

https://git.ruby-lang.org/ruby.git/commit/?id=bb05cdcd78

From bb05cdcd78b3e3d54f0ad9afc01de383ed33dc1c Mon Sep 17 00:00:00 2001
From: Marcus Stollsteimer <sto.mar@w...>
Date: Sun, 22 Dec 2019 22:36:14 +0100
Subject: [DOC] Improve documentation for Enumerable#tally


diff --git a/enum.c b/enum.c
index db5f4d3..cc77964 100644
--- a/enum.c
+++ b/enum.c
@@ -1002,11 +1002,11 @@ tally_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash)) https://github.com/ruby/ruby/blob/trunk/enum.c#L1002
  *  call-seq:
  *     enum.tally -> a_hash
  *
- *  Tallys the collection.  Returns a hash where the keys are the
- *  elements and the values are numbers of elements in the collection
- *  that correspond to the key.
+ *  Tallies the collection, i.e., counts the occurrences of each element.
+ *  Returns a hash with the elements of the collection as keys and the
+ *  corresponding counts as values.
  *
- *     ["a", "b", "c", "b"].tally #=> {"a"=>1, "b"=>2, "c"=>1}
+ *     ["a", "b", "c", "b"].tally  #=> {"a"=>1, "b"=>2, "c"=>1}
  */
 
 static VALUE
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]