mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update example code in Enumerator#chunk documentation [ci skip]
The code assumed that /usr/share/dict/words did not use mixed case, and it does at least on a few operating systems. From CryptoRAT (Luke Elliot) Fixes [Bug #16957]
This commit is contained in:
parent
510df47f5f
commit
b212c7c7d1
1 changed files with 1 additions and 1 deletions
2
enum.c
2
enum.c
|
@ -3203,7 +3203,7 @@ chunk_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
|
|||
* The following example counts words for each initial letter.
|
||||
*
|
||||
* open("/usr/share/dict/words", "r:iso-8859-1") { |f|
|
||||
* f.chunk { |line| line.ord }.each { |ch, lines| p [ch.chr, lines.length] }
|
||||
* f.chunk { |line| line.upcase.ord }.each { |ch, lines| p [ch.chr, lines.length] }
|
||||
* }
|
||||
* #=> ["\n", 1]
|
||||
* # ["A", 1327]
|
||||
|
|
Loading…
Add table
Reference in a new issue