aboutsummaryrefslogtreecommitdiffstats
path: root/lib/set.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-15 11:55:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-15 11:55:52 +0000
commit3a47cf3395dd4c4fe8bdd5df13aab698f2ca314b (patch)
treec4a278220ba8141b829c5c7b0777c1049cfe413c /lib/set.rb
parent39da1b63699faf30c86e753e193c29b81b16136d (diff)
downloadruby-3a47cf3395dd4c4fe8bdd5df13aab698f2ca314b.tar.gz
* remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/set.rb')
-rwxr-xr-xlib/set.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/set.rb b/lib/set.rb
index 99197961b5..226641d725 100755
--- a/lib/set.rb
+++ b/lib/set.rb
@@ -482,35 +482,35 @@ class Set
end
end
-#
+#
# SortedSet implements a Set that guarantees that it's element are
# yielded in sorted order (according to the return values of their
# #<=> methods) when iterating over them.
-#
+#
# All elements that are added to a SortedSet must respond to the <=>
# method for comparison.
-#
+#
# Also, all elements must be <em>mutually comparable</em>: <tt>el1 <=>
# el2</tt> must not return <tt>nil</tt> for any elements <tt>el1</tt>
# and <tt>el2</tt>, else an ArgumentError will be raised when
# iterating over the SortedSet.
#
# == Example
-#
+#
# require "set"
-#
+#
# set = SortedSet.new([2, 1, 5, 6, 4, 5, 3, 3, 3])
# ary = []
-#
+#
# set.each do |obj|
# ary << obj
# end
-#
+#
# p ary # => [1, 2, 3, 4, 5, 6]
-#
+#
# set2 = SortedSet.new([1, 2, "3"])
# set2.each { |obj| } # => raises ArgumentError: comparison of Fixnum with String failed
-#
+#
class SortedSet < Set
@@setup = false
@@ -535,7 +535,7 @@ class SortedSet < Set
@hash = RBTree.new
super
end
-
+
def add(o)
o.respond_to?(:<=>) or raise ArgumentError, "value must respond to <=>"
super