| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
remove redundant paragraph at set.rb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using the block param in a boolean context like this cause it to be
allocated.
Using it with an `if` or `unless` was optimized in 3.2
(https://github.com/ruby/ruby/pull/6286) but using it with `or`
or `and` wasn't.
```ruby
def foo(&block)
block or return 1
end
puts RubyVM::InstructionSequence.of(method(:foo)).disasm
== disasm: #<ISeq:foo@(irb):11 (11,0)-(13,3)> (catch: false)
local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: 0, kw: -1@-1, kwrest: -1])
[ 1] block@0<Block>
0000 getblockparam block@0, 0 ( 12)[LiCa]
0003 dup
0004 branchif 10
0006 pop
0007 putobject_INT2FIX_1_
0008 leave [Re]
0009 putnil
0010 leave
```
versus
```
def foo(&block)
return 1 if block
end
puts RubyVM::InstructionSequence.of(method(:foo)).disasm
== disasm: #<ISeq:foo@(irb):15 (15,0)-(17,3)> (catch: false)
local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: 0, kw: -1@-1, kwrest: -1])
[ 1] block@0<Block>
0000 getblockparamproxy block@0, 0 ( 16)[LiCa]
0003 branchunless 7
0005 putobject_INT2FIX_1_
0006 leave ( 17)[Re]
0007 putnil ( 16)
0008 leave
```
https://github.com/ruby/set/commit/e89da977d4
|
| |
|
|
|
|
| |
https://github.com/ruby/set/commit/71a876ae81
|
|
|
|
| |
https://github.com/ruby/set/commit/292baacb60
|
| |
|
|
|
|
| |
https://github.com/ruby/set/commit/f467028cdb
|
|
|
|
| |
https://github.com/ruby/set/commit/76b056c3b9
|
|
|
|
| |
https://github.com/ruby/set/commit/dd787a3988
|
|
|
|
| |
https://github.com/ruby/set/commit/35b69e9d69
|
|
|
|
| |
https://github.com/ruby/set/commit/1a73ab9047
|
|
|
|
|
|
| |
Implements [Feature #17838]
https://github.com/ruby/set/commit/d9b389bafa
|
|
|
|
| |
https://github.com/ruby/set/commit/257dc452a7
|
|
|
|
| |
https://github.com/ruby/set/commit/8f4c62768d
|
|
|
|
| |
https://github.com/ruby/set/commit/254d927c8c
|
|
|
|
| |
https://github.com/ruby/set/commit/ab81354de1
|
|
|
|
|
| |
- Eliminate warnings
- Convert rdoc to markdown
|
|
|
|
|
|
|
|
| |
- SortedSet has been removed for dependency and performance reasons.
- Set#join is added as a shorthand for `.to_a.join`.
- Set#<=> is added.
https://github.com/ruby/set/blob/v1.0.0/CHANGELOG.md
|
|
|
|
| |
https://github.com/ruby/set/commit/447974a374
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It required RBTree to perform decently and the external dependency was
not suitable for a standard library. The pure ruby fallback
implementation was originally meant to be an example of how to write a
subclass of Set, and its poor performance was not suitable for use in
production.
I decided it should be distributed as an external library instead of
bundling it with Set.
https://github.com/ruby/set/commit/dfcc8e568b
|
|
|
|
|
|
| |
In Ruby 2.x, initialize_copy does not take a freeze option.
https://github.com/ruby/set/commit/3da6c309df
|
|
|
|
| |
Fixes [Bug #15834]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This freezes the clone even if the receiver is not frozen. It
is only for consistency with freeze: false not freezing the clone
even if the receiver is frozen.
Because Object#clone is now partially implemented in Ruby and
not fully implemented in C, freeze: nil must be supported to
provide the default behavior of only freezing the clone if the
receiver is frozen.
This requires modifying delegate and set, to set freeze: nil
instead of freeze: true as the keyword parameter for
initialize_clone. Those are the two libraries in stdlib that
override initialize_clone.
Implements [Feature #16175]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes it possible to initialize_clone to correctly not freeze
internal state if the freeze: false keyword is passed to clone.
If clone is called with freeze: true or no keyword, do not pass
a second argument to initialize_clone to keep backwards
compatibility.
This makes it so that external libraries that override
initialize_clone but do not support the freeze keyword will fail
with ArgumentError if passing freeze: false to clone. I think that
is better than the current behavior, which succeeds but results in
an unfrozen object with frozen internals.
Fix related issues in set and delegate in stdlib.
Fixes [Bug #14266]
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The first time SortedSet#initialize is called, it overwrites
itself, then recalls #initialize, which results in calling the
subclass's initialize, not the current initialize.
Just inline the default initialize behavior to avoid this issue.
No test for this as it can only be triggered the very first time
that SortedSet#initialize is called.
Fixes [Bug #15830]
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* In Enumerable, Enumerator::Lazy, Array, Hash and Set
[Feature #13784] [ruby-core:82285]
* Share specs for the various #select#select! methods and
reuse them for #filter/#filter!.
* Add corresponding filter tests for select tests.
* Update NEWS.
[Fix GH-1824]
From: Alexander Patrick <adp90@case.edu>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* lib/set.rb: [DOC] add examples for Set#replace,
add examples for creating a set from a hash with duplicates,
simplify and fix style of some other examples, fix typos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
GitHub PR: https://github.com/ruby/ruby/pull/1752 [Fix GH-1752]
Submitted by: @Ana06 <anamma06@gmail.com>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* lib/set.rb: [DOC] improve description and examples for Set#===.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
This method resets the internal state of a set after modification to
existing elements, reindexing and deduplicating them. [Feature #6589]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
That prevents infinite recursion when a subclass of Set uses
`collect!` in its constructor.
This should fix [Bug #12437].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
This should fix comparison of rbtree backed SortedSet instances.
[Bug #12072]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
This should fix [Bug #13735].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* set.rb (Set#===): Added via [Feature #13801] by davidarnold.
Closes #1673.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* lib/set.rb (Set#compare_by_identity, Set#compare_by_identity?):
New methods. [Feature #12210]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
Set#{delete_if,keep_if,collect!,reject!,select!,
classify,divide} without block returns an enumerator.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
SortedSet#{delete_if,keep_if}): Return sized enumerators.
* test/test_set.rb: add test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* lib/set.rb: Move << out of the begin block that ensures pop.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
#select!, #^, #classify): Micro-optimize some methods for
performance and readability.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
#<= when comparing against an instance of the same kind.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
enumerator. [GH-931] by kachick (Kenichi Kamiya)
* test/test_set.rb: Import tests from Set into SortedSet. [GH-931]
by kachick (Kenichi Kamiya)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
check member equality
* lib/set.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|