aboutsummaryrefslogtreecommitdiffstats
path: root/array.c
Commit message (Collapse)AuthorAgeFilesLines
* Add What's Here to Array RDoc (#4062)Burdette Lamar2021-01-151-0/+174
| | | | * Add What's Here to Array RDoc
* Document usage of ArithmeticSequence in Array#slice, and add to NEWS (#3952)Victor Shepelev2020-12-211-5/+16
|
* Use category: :deprecated in warnings that are related to deprecationJeremy Evans2020-12-181-1/+1
| | | | | | | | | | | | | | | | | Also document that both :deprecated and :experimental are supported :category option values. The locations where warnings were marked as deprecation warnings was previously reviewed by shyouhei. Comment a couple locations where deprecation warnings should probably be used but are not currently used because deprecation warning enablement has not occurred at the time they are called (RUBY_FREE_MIN, RUBY_HEAP_MIN_SLOTS, -K). Add assert_deprecated_warn to test assertions. Use this to simplify some tests, and fix failing tests after marking some warnings with deprecated category.
* tuning trial: newobj with current ecKoichi Sasada2020-12-071-0/+52
| | | | | Passing current ec can improve performance of newobj. This patch tries it for Array and String literals ([] and '').
* should not use rb_ary_modify()Koichi Sasada2020-12-011-11/+17
| | | | | | | | | | | ractor_copy() used rb_ary_modify() to make sure this array is not sharing anything, but it also checks frozen flag. So frozen arrays raises an error. To solve this issue, this patch introduces new function rb_ary_cancel_sharing() which makes sure the array does not share another array and it doesn't check frozen flag. [Bug #17343] A test is quoted from https://github.com/ruby/ruby/pull/3817
* Removed canonicalization for mathnNobuyoshi Nakada2020-11-101-7/+1
|
* Fix linksS-H-GAMELINKS2020-11-101-1/+1
|
* Make Array methods return Array instances instead of subclass instancesJeremy Evans2020-11-031-7/+5
| | | | | | | | | | | | | | | | This changes the following methods to return Array instances instead of subclass instances: * Array#drop * Array#drop_while * Array#flatten * Array#slice! * Array#slice/#[] * Array#take * Array#take_while * Array#uniq * Array#* Fixes [Bug #6087]
* Don't redefine #rb_intern over and over againStefan Stüben2020-10-211-3/+0
|
* Feature #16812: Allow slicing arrays with ArithmeticSequence (#3241)Kenta Murata2020-10-211-8/+83
| | | | | | | | | | | | | | | | | * Support ArithmeticSequence in Array#slice * Extract rb_range_component_beg_len * Use rb_range_values to check Range object * Fix ary_make_partial_step * Fix for negative step cases * range.c: Describe the role of err argument in rb_range_component_beg_len * Raise a RangeError when an arithmetic sequence refers the outside of an array [Feature #16812]
* Comply with guide for method doc: array.c (#3506)Burdette Lamar2020-09-021-103/+47
| | | | | | | | | | | | | Methods: any? all? one? none? sum shuffle! shuffle sample
* Comply with guide for method doc: array.c (#3499)Burdette Lamar2020-09-011-95/+12
| | | | | | | | | | | | | | | | | | | Methods considered: count flatten! flatten cycle permutation combination repeated_permutation repeated_combination product take take_while drop drop_while
* Comply with guide for method doc: array.c (#3489)Burdette Lamar2020-08-311-63/+11
| | | | | | | | | | | | | | | | Methods considered: & intersection | union max min minmax uniq! uniq compact! compact
* Comply with guide for method doc: array.c (#3484)Burdette Lamar2020-08-311-74/+19
| | | | | | | | | | | | | | | | | Methods: + concat * assoc rassoc == eql? hash include? <=> - difference
* Comply with guide for method doc: array.c (#3477)Burdette Lamar2020-08-311-90/+14
| | | | | | | | | | | | | | | Methods considered: delete_at slice! reject! reject delete_if zip transpose replace clear fill
* Comply with guide for method doc: array.c (#3475)Burdette Lamar2020-08-301-54/+17
| | | | | | | | | | | | | | | | Methods considered: bsearch bsearch_index sort_by! collect collect! values_at select select! keep_if delete
* Comply with guide for method doc: array.c (#3474)Burdette Lamar2020-08-291-82/+13
| | | | | | | | | | | | | | | | | | | Methods considered: length empty? join inspect to_a to_h to_ary reverse! reverse rotate! rotate sort! sort
* Comply with guide for method doc: array.c (#3473)Burdette Lamar2020-08-291-143/+29
| | | | | | | | | | | | | | | | Methods considered: at first last fetch index rindex [] insert each each_index reverse_each
* Comply with guide for method doc: array.c (#3469)Burdette Lamar2020-08-281-122/+33
| | | | | | | | | | | | | Methods: - freeze - try_convert - new - \<< - push - pop - shift - unshift - []
* Remove checks for self returned in array.c and hash.c examples (#3446)Burdette Lamar2020-08-231-100/+33
| | | Further compliance with https://github.com/ruby/ruby/blob/master/doc/method_documentation.rdoc#details-and-examples-
* Remove trivial examples from array.c (#3442)Burdette Lamar2020-08-211-72/+12
| | | "Trivial" typically means "returns a new empty Array."
* Remove nil-return examples from array.c (#3437)Burdette Lamar2020-08-201-80/+24
|
* Partial compliance with doc/method_documentation.rdoc (#3431)Burdette Lamar2020-08-191-400/+54
| | | Removes references to *-convertible thingies.
* RARRAY_AREF: convert into an inline function卜部昌平2020-08-151-1/+1
| | | | | | RARRAY_AREF has been a macro for reasons. We might not be able to change that for public APIs, but why not relax the situation internally to make it an inline function.
* Fix links to Dig Methods document (#3421)Burdette Lamar2020-08-141-1/+1
| | | | | * Fix links to Dig Methods document * Fix links to Dig Methods document
* Adding doc/dig_methods.rdoc and links to it (#3416)Burdette Lamar2020-08-131-11/+12
| | | | | | | Adds a full discussion of #dig, along with links from Array, Hash, Struct, and OpenStruct. CSV::Table and CSV::Row are over in ruby/csv. I'll get to them soon. The art to the thing is to figure out how much (or how little) to say at each #dig.
* MAYBE_UNUSED should just suffice卜部昌平2020-08-131-5/+2
| | | | This reverts commit c355fa72d4e356378a8b03a67432b52bafcc308b.
* Enhanced RDoc for Array (#3400)Burdette Lamar2020-08-101-28/+180
| | | | | | | | | | | Methods: drop drop_while any? all? none? one?
* Removed non-ASCII code to suppress warnings by localized compilersNobuyoshi Nakada2020-08-101-2/+2
|
* Suppress unused-function warningsNobuyoshi Nakada2020-08-101-0/+5
| | | | Calls with a constant argument should be optimized away.
* Enhanced RDoc for Array#take and Array#take_while (#3398)Burdette Lamar2020-08-071-19/+38
|
* Enhanced RDoc for Array#product (#3395)Burdette Lamar2020-08-071-13/+55
|
* Enhanced documentation for Array#repeated_combination (#3392)Burdette Lamar2020-08-051-25/+62
| | | | | * Enhanced documentation for Array#repeated_combination * Enhanced documentation for Array#repeated_combination
* Enhanced documentation for Array#repeated_permutation (#3390)Burdette Lamar2020-08-051-14/+63
| | | | | * Enhanced documentation for Array#repeated_permutation * Enhanced documentation for Array#repeated_permutation
* Initialize memo pointer and use it consistently to silence gcc 7+Nobuyoshi Nakada2020-08-011-5/+5
|
* Enhanced RDoc for ArrayBurdette Lamar2020-07-311-44/+159
|
* Document Array#flatten{,!} accept explicit nil argument [ci skip]Jeremy Evans2020-07-301-4/+4
| | | | Fixes [Bug #10475]
* Fix Array#flatten for recursive array when given positive depth [Bug #17092]Marc-Andre Lafortune2020-07-301-18/+26
|
* Enhanced RDoc for Array (#3372)Burdette Lamar2020-07-291-80/+142
|
* Enhanced RDoc for Array [ci skip]BurdetteLamar2020-07-281-96/+240
|
* Use https instead of httpKazuhiro NISHIYAMA2020-07-281-1/+1
|
* Enhanced RDoc for Array (#3350)Burdette Lamar2020-07-221-46/+72
| | | | | | | | | | | | * Enhanced RDoc for Array Methods: == eql? hash include? <=>
* Enhanced RDoc for ArrayBurdetteLamar2020-07-211-7/+1
|
* Enhanced RDoc for ArrayBurdetteLamar2020-07-211-2/+4
|
* Enhanced RDoc for ArrayBurdetteLamar2020-07-211-60/+90
|
* Optimize Array#min (#3324)Kenta Murata2020-07-181-7/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The benchmark result is below: | |compare-ruby|built-ruby| |:---------------|-----------:|---------:| |ary2.min | 39.105M| 39.442M| | | -| 1.01x| |ary10.min | 23.995M| 30.762M| | | -| 1.28x| |ary100.min | 6.249M| 10.783M| | | -| 1.73x| |ary500.min | 1.408M| 2.714M| | | -| 1.93x| |ary1000.min | 828.397k| 1.465M| | | -| 1.77x| |ary2000.min | 332.256k| 570.504k| | | -| 1.72x| |ary3000.min | 338.079k| 573.868k| | | -| 1.70x| |ary5000.min | 168.217k| 286.114k| | | -| 1.70x| |ary10000.min | 85.512k| 143.551k| | | -| 1.68x| |ary20000.min | 43.264k| 71.935k| | | -| 1.66x| |ary50000.min | 17.317k| 29.107k| | | -| 1.68x| |ary100000.min | 9.072k| 14.540k| | | -| 1.60x| |ary1000000.min | 872.930| 1.436k| | | -| 1.64x| compare-ruby is 9f4b7fc82e.
* Optimize Array#max (#3325)Kenta Murata2020-07-181-7/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The benchmark result is below: | |compare-ruby|built-ruby| |:---------------|-----------:|---------:| |ary2.max | 38.837M| 40.830M| | | -| 1.05x| |ary10.max | 23.035M| 32.626M| | | -| 1.42x| |ary100.max | 5.490M| 11.020M| | | -| 2.01x| |ary500.max | 1.324M| 2.679M| | | -| 2.02x| |ary1000.max | 699.167k| 1.403M| | | -| 2.01x| |ary2000.max | 284.321k| 570.446k| | | -| 2.01x| |ary3000.max | 282.613k| 571.683k| | | -| 2.02x| |ary5000.max | 145.120k| 285.546k| | | -| 1.97x| |ary10000.max | 72.102k| 142.831k| | | -| 1.98x| |ary20000.max | 36.065k| 72.077k| | | -| 2.00x| |ary50000.max | 14.343k| 29.139k| | | -| 2.03x| |ary100000.max | 7.586k| 14.472k| | | -| 1.91x| |ary1000000.max | 726.915| 1.495k| | | -| 2.06x|
* Enhanced RDoc for Array#fill (#3301)Burdette Lamar2020-07-111-20/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Enhanced RDoc for Array#fill * Update array.c There's one more at 5072. I'll get it. Co-authored-by: Eric Hodel <drbrain@segment7.net> * Update array.c Co-authored-by: Eric Hodel <drbrain@segment7.net> * Update array.c Co-authored-by: Eric Hodel <drbrain@segment7.net> * Update array.c Co-authored-by: Eric Hodel <drbrain@segment7.net> * Update array.c Co-authored-by: Eric Hodel <drbrain@segment7.net> * Update array.c Co-authored-by: Eric Hodel <drbrain@segment7.net>
* Enhanced RDoc for Array (#3282)Burdette Lamar2020-07-081-59/+140
| | | | | | | | | | | | Methods: reject! reject delete_if zip transpose replace clear
* Enhanced RDoc for Array (#3276)Burdette Lamar2020-07-031-51/+191
| | | | | | | | | *Methods: keep_if delete delete_at slice!