summaryrefslogtreecommitdiff
path: root/lib/set.rb
AgeCommit message (Collapse)Author
2016-05-04* lib/set.rb: [DOC] add documentation that ↵ktsj
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
2016-05-04* lib/set.rb (Set#{delete_if,keep_if,collect!,reject!,select!,classify,divide},ktsj
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
2015-11-16* lib/set.rb: Enable frozen_string_literal.knu
* 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
2015-11-16Explain the reason for calling do_with_enum without a block [ci skip]knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-16* lib/set.rb (Hash#flatten!, #add?, #delete?, #collect!, #reject!,knu
#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
2015-11-16* lib/set.rb (#>=, #>, #<=, #<): Make use of Hash#>=, #>, #<, andknu
#<= 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
2015-06-15* lib/set.rb: Make Set#each and SortedSet#each generate a sizedknu
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
2015-02-17* hash.c: Added docs to explain that #include? and #member? do nothsbt
check member equality * lib/set.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-11set: speed up Set#include?normal
* lib/set.rb (initialize): internal hash defaults to false * lib/set.rb (include?): use Hash#[] for optimized dispatch. Patch by Ismael Abreu <ismaelga@gmail.com> [ruby-core:67664] [Misc #10754] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-06* lib/set.rb (Set#replace): Check if an object given is enumerableknu
before clearing self. Reported by yui-knk. [GH-675] https://github.com/ruby/ruby/pull/675 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-06Implement Set#clone. [Fixes GH-661]knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05* lib/set.rb: [DOC] Fix grammatical error by @bouk [fix GH-524]hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-28* lib/set.rb: [DOC] Add examples for Set#intersect? and Set#disjoint?zzak
Patch by xavier nayrac [Bug #9331] [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22* lib/set.rb (class SortedSet): Fix source_location for methods defined via ↵tmm1
eval. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-31* lib/set.rb: [DOC] Add a couple of notes on Hash as storage.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-31* lib/set.rb: [DOC] Fix example result. Hash is now ordered.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-31Use the term "sorted" instead "ordered" when mentioning SortSet.knu
* lib/set.rb: [DOC] Use the term "sorted" instead "ordered" when mentioning SortSet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-30Add Set#intersect? and #disjoint?.knu
* lib/set.rb (Set#intersect?, Set#disjoint?): Add new methods for testing if two sets have any element in common. [ruby-core:45641] [Feature #6588] Based on the code by marcandre. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-19Define Set#to_set so that aSet.to_set returns self.knu
* lib/set.rb (Set#to_set): Define Set#to_set so that aSet.to_set returns self. [Fixes GH-359] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-01* lib/set.rb (Set#freeze, taint, untaint): Save a "self" byknu
utilizing super returning self, and add tests while at it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-20* lib/set.rb (Set#delete_if, Set#keep_if): Avoid blockless call ofknu
proc, which is not portable to JRuby. Replace &method() with faster and simpler literal blocks while at it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19* lib/set.rb (Set#delete_if, Set#keep_if): Add comments.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18* lib/set.rb (Set#delete_if, Set#keep_if): Make Set#delete_if andknu
Set#keep_if more space and time efficient by avoiding to_a. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-24Move tests embedded in lib/set.rb to test/test_set.rb.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-22Drop executable bits.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-01* lib/set.rb (#initialize_copy, #eql): Use instance_variable_getknu
instead of instance_eval. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-31* lib/set.rb (Set#{each,reject!,select!}, SortedSet#each): Passknu
the original block through instead of creating one that only yields the passed argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-30* lib/set.rb (Set#{<,>,<=,>=}): Define comparison operators asknu
shorthand for the {proper_}{subset?,superset?} methods (finally). Given a push by Alexander E. Fischer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-20* lib/set.rb (SortedSet.setup): remove old_init after initializeakr
method is redefined. The remove before redefinition makes the warning prevention fragile. [ruby-dev:44892] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-20* lib/set.rb (SortedSet.setup): don't remove old_init. The removeakr
makes the warning prevention fragile. [ruby-dev:44892] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-05* ext/pathname/lib/pathname.rb, ext/tk/lib/multi-tk.rb,ktsj
ext/tk/sample/demos-en/widget, lib/benchmark.rb, lib/irb/cmd/fork.rb, lib/mkmf.rb, lib/net/ftp.rb, lib/net/smtp.rb, lib/open3.rb, lib/pstore.rb, lib/rexml/element.rb, lib/rexml/light/node.rb, lib/rinda/tuplespace.rb, lib/rss/maker/base.rb, lib/rss/maker/entry.rb, lib/scanf.rb, lib/set.rb, lib/shell.rb, lib/shell/command-processor.rb, lib/shell/process-controller.rb, lib/shell/system-command.rb, lib/uri/common.rb: remove unused block arguments to avoid creating Proc objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-19* lib: revert r31635-r31638 and untabify with expand(1).nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18 * lib: Convert tabs to spaces for ruby files perdrbrain
http://redmine.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style Patch by Steve Klabnik [Ruby 1.9 - Bug #4730] Patch by Jason Dew [Ruby 1.9 - Feature #4718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-11 * lib/set.rb (class Set): Add nodoc to internal-use methods. Patch by ↵drbrain
Pete Higgins. [Ruby 1.9 - Bug #4665] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-10* lib/set.rb (Set#replace): Apply a bit of optimization.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-30* lib/set.rb (keep_if, select!): New methods [ruby-core:29749]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-11Fri Feb 12 02:27:39 2010 Akinori MUSHA <knu@iDaemons.org>knu
* lib/set.rb (Set#initialize, Set#replace, Set#merge) (Set#subtract, Set#&): Fix duck type tests. [ruby-core:28078] * lib/set.rb (Set#initialize, Set#replace, Set#merge) (Set#subtract, Set#&): Try #each if #each_entry fails. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-02* enum.c (enum_each_entry): new method #each_entry to pack valuesmatz
from yield into an array. * lib/set.rb (Set#merge): use Enumerable#each_entry to implement Set compatible to 1.8 behavior. [ruby-core:27985] * lib/set.rb: replace is_a?(Enumerable) with respond_to?(:each) for duck typing. * lib/set.rb (SortedSet#add): typo fixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-19* lib/set.rb: Add checks that passed argument is Enumerable. [ruby-core:23844]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-13* lib/set.rb (==): Optimization; patch by Arthur Schreiber [ruby-core:17203]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-07* lib/set.rb (SortedSet#add): Do not require each newly addedknu
element to be Comparable but to respond to <=>. [ruby-dev:38371] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-02* lib/set.rb (SortedSet): Fix document. [Bug #1429]knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-01* lib/set.rb (Set#merge): Only directly use the passed objectsknu
@hash instance variable when self and the passed object are instances of the same class. [Bug #118] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-01* lib/set.rb (SortedSet#add): Do not let an uncomparable objectknu
in. [Bug #118] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06* {ext,lib,test}/**/*.rb: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13* golf_prelude.rb, lib/set.rb (TC_Set#test_each),knu
test/readline/test_readline_history.rb (Readline#test_each__enumerator), test/ruby/test_array.rb (TestArray#test_collect), test/ruby/test_enumerator.rb (TestEnumerator#test_initialize): Enumerable::Enumerator is now called Enumerator. * lib/rinda/tuplespace.rb (Rinda::TupleBag#initialize): Use enum_for instead of hardcoding Enumerable::Enumerator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09* lib/set.rb (Set#delete_if): Call to_a.knu
(SortedSet#delete_if, TC_SortedSet#test_sortedset): Use super to yield elements in sorted order; [ruby-core:17144] by Arthur Schreiber. (SortedSet#each, SortedSet#each, TC_Set#test_each) (TC_SortedSet#test_sortedset): Return self; [ruby-dev:35002] by Arthur Schreiber. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-03* lib/set.rb (Set#classify): Back out the `group_by' alias.knu
Better think twice. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-03Properly back out.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e