summaryrefslogtreecommitdiff
path: root/enum.c
AgeCommit message (Collapse)Author
2021-11-16Make Enumerable#each_cons return object if over sizeJeremy Evans
This behavior changed in dfb47bbd17c3c2b8ce17dbafaf62df023b0224b2, but only for normal exit, not for early exit. Fix it for early exit as well. While here, fix example code in documentation so that it doesn't indicate that the method returns nil. Notes: Merged: https://github.com/ruby/ruby/pull/5129
2021-11-05Delegate keywords from Enumerable#to_a to #eachJeremy Evans
Fixes [Bug #18289] Notes: Merged: https://github.com/ruby/ruby/pull/5086
2021-10-25Fix `Enumerable#each_cons` and `Enumerable#each_slice` to return a receiverTSUYUSATO Kitsune
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/1509 Merged-By: nobu <nobu@ruby-lang.org>
2021-10-25[DOC] Fix code markup [ci skip]Nobuyoshi Nakada
Code markup in RDoc must not be concatenated with anothr word.
2021-10-06Accommondate earlier reviews of RDoc for Enumerable (#4943)Burdette Lamar
Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-10-06Enhanced RDoc for Enumerable (#4941)Burdette Lamar
Treated: #sum #uniq #compact Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-10-05Enhanced RDoc for Enumerable (#4938)Burdette Lamar
Treats: #slice_after #slice_when #chunk_while Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-10-05Enhanced RDoc for Enumerable#slice_before (#4932)Burdette Lamar
* Enhanced RDoc for Enumerable#slice_before * Enhanced RDoc for Enumerable#slice_before Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-10-04Enhanced RDoc for Enumerable#chunk (#4930)Burdette Lamar
Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-10-03Using NIL_P macro instead of `== Qnil`S.H
Notes: Merged: https://github.com/ruby/ruby/pull/4925 Merged-By: nobu <nobu@ruby-lang.org>
2021-10-01Enhanced RDoc for Enumerable (#4922)Burdette Lamar
Treated: #drop #drop_while #cycle Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-10-01Enhanced RDoc for Enumerable (#4918)Burdette Lamar
Treats: #zip #take #take_while Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-09-30Enhanced RDoc for Enumerable (#4917)Burdette Lamar
Treats: #each_with_index #reverse_each #each_entry #each_slice #each_cons #each_with_object Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-09-29Enhanced RDoc for Enumerable (#4910)Burdette Lamar
Treats: #min #max #minmax #min_by #max_by #minmax_by #include? Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-09-28Enhanced RDoc for Enumerable (#4908)Burdette Lamar
Treated: #none? #one? #min Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-09-28Enhanced RDoc for Enumerable (#4906)Burdette Lamar
Treats: #partition #group_by #tally #first #sort #sort_by #all? #any? Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-09-20Enhanced RDoc for Enumerable#inject (#4876)Burdette Lamar
Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-09-11Using RB_BIGNUM_TYPE_P macroS-H-GAMELINKS
Notes: Merged: https://github.com/ruby/ruby/pull/4805
2021-09-10Enhanced RDoc for Enumerable (#4808)Burdette Lamar
#to_a #to_h #inject Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-07-27Extracted repeatedly defined IDsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4684
2021-05-10Enhanced RDoc for Enumerable (#4479)Burdette Lamar
Methods treated: #count #find #find_index #select #filter_map #reject #map #flat_map Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-05-08Enhanced RDoc for Enumerable (#4473)Burdette Lamar
Enhanced RDoc for Enumerable: #grep and #grep_v. Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-03-27Fix Enumerable#tally with some arguments pattern [Feature #17744]Kenichi Kamiya
* Add test cases for Enumerable#tally with hash argument * Add ruby/spec for Enumerable#tally with hash argument * Fix Enumerable#tally does not update given frozen hash * Add test cases for Enumerable#tally with hash convertible arguments * Fix SEGV when Enumerable#tally takes non Hash convertible * FIx cosmetic damage enum.c Notes: Merged: https://github.com/ruby/ruby/pull/4327 Merged-By: nobu <nobu@ruby-lang.org>
2021-03-26Enumerable#tally with the resulting hash [Feature #17744]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4318 Merged-By: nobu <nobu@ruby-lang.org>
2021-03-20Add write-barrier in tallyNobuyoshi Nakada
2021-03-19Fix Enumerable#inject with high negative fixnums [Bug #17731]Marc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/4288
2021-03-16Improve Enumerable#tally performanceNobuyoshi Nakada
Iteration per second (i/s) | |compare-ruby|built-ruby| |:------|-----------:|---------:| |tally | 52.814| 114.936| | | -| 2.18x| Notes: Merged: https://github.com/ruby/ruby/pull/4278
2021-01-04RDoc: Enhanced introduction for Enumerable (#4004)Burdette Lamar
* RDoc: Enhanced introduction for Enumerable * RDoc: Enhanced introduction for Enumerable * RDoc: Enhanced introduction for Enumerable Notes: Merged-By: marcandre <github@marc-andre.ca>
2021-01-05Fix indent [ci skip]Kazuhiro NISHIYAMA
Suggested by @hanachin at https://github.com/rurema/doctree/pull/2425#discussion_r551327592
2021-01-02Add Enumerable#compact and Enumerator::Lazy#compactzverok
Notes: Merged: https://github.com/ruby/ruby/pull/3851
2020-12-16Removed leading spaces [ci skip]Nobuyoshi Nakada
2020-12-15Optimize `Enumerable#grep{_v}`Marc-Andre Lafortune
[Bug #17030] Notes: Merged: https://github.com/ruby/ruby/pull/3868
2020-11-10Removed canonicalization for mathnNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3691
2020-11-10Fix linksS-H-GAMELINKS
Notes: Merged: https://github.com/ruby/ruby/pull/3738
2020-10-21Don't redefine #rb_intern over and over againStefan Stüben
Notes: Merged: https://github.com/ruby/ruby/pull/3589
2020-07-24Respect visibility in non-array Enumerable#inject [Bug #13592]Nobuyoshi Nakada
2020-06-29add spaces [ci skip]卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/3247
2020-06-29sum_iter: do not goto into a branch卜部昌平
I'm not necessarily against every goto in general, but jumping into a branch is definitely a bad idea. Better refactor. Notes: Merged: https://github.com/ruby/ruby/pull/3247
2020-06-12Update example code in Enumerator#chunk documentation [ci skip]Jeremy Evans
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]
2020-06-07docs: fix typoszTheory
Notes: Merged: https://github.com/ruby/ruby/pull/3183
2020-05-26Fix max, min, minmax documentation (#3131)Masataka Pocke Kuwabara
They only need that all objects implement <=>, but the documentation said it needs Comparable. Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2020-05-11Added more NORETURN declarationsNobuyoshi Nakada
2019-12-26decouple internal.h headers卜部昌平
Saves comitters' daily life by avoid #include-ing everything from internal.h to make each file do so instead. This would significantly speed up incremental builds. We take the following inclusion order in this changeset: 1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very first thing among everything). 2. RUBY_EXTCONF_H if any. 3. Standard C headers, sorted alphabetically. 4. Other system headers, maybe guarded by #ifdef 5. Everything else, sorted alphabetically. Exceptions are those win32-related headers, which tend not be self- containing (headers have inclusion order dependencies). Notes: Merged: https://github.com/ruby/ruby/pull/2711
2019-12-22[DOC] Improve documentation for Enumerable#tallyMarcus Stollsteimer
2019-12-11Added documentation for integer range sums (#1593)Eli Sadoff
2019-12-11Indicate `find_all` and `select` methods are aliases.Corey Farwell
This matches the documentation for `Enumerable::inject` and `Enumerable::reduce` which are also aliases.
2019-11-29check interrupts at each frame pop timing.Koichi Sasada
Asynchronous events such as signal trap, finalization timing, thread switching and so on are managed by "interrupt_flag". Ruby's threads check this flag periodically and if a thread does not check this flag, above events doesn't happen. This checking is CHECK_INTS() (related) macro and it is placed at some places (laeve instruction and so on). However, at the end of C methods, C blocks (IMEMO_IFUNC) etc there are no checking and it can introduce uninterruptible thread. To modify this situation, we decide to place CHECK_INTS() at vm_pop_frame(). It increases interrupt checking points. [Bug #16366] This patch can introduce unexpected events...
2019-11-19Fix memory corruption in Enumerable#reverse_each [ruby-dev:50867] [Bug #16354]Kazuki Tsujimoto
2019-11-18Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans
This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby. Notes: Merged: https://github.com/ruby/ruby/pull/2476
2019-08-27rb_rescue / rb_rescue2 now free from ANYARGS卜部昌平
After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from rb_rescue / rb_rescue2, which revealed many arity / type mismatches.