[前][次][番号順一覧][スレッド一覧]

ruby-changes:67021

From: Troy <ko1@a...>
Date: Mon, 2 Aug 2021 12:09:16 +0900 (JST)
Subject: [ruby-changes:67021] 7f4e86804d (master): Fix documentation of #<=> and #casecmp [ci skip]

https://git.ruby-lang.org/ruby.git/commit/?id=7f4e86804d

From 7f4e86804d426d79807cc038fe4444f7c65f5c4a Mon Sep 17 00:00:00 2001
From: Troy Chance <10200447+sftroychance@u...>
Date: Sun, 1 Aug 2021 20:09:07 -0700
Subject: Fix documentation of #<=> and #casecmp [ci skip]

Descriptions for return values of -1 and 1 were reversed.
---
 string.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/string.c b/string.c
index 2c0140a..2048b5b 100644
--- a/string.c
+++ b/string.c
@@ -3447,9 +3447,9 @@ rb_str_eql(VALUE str1, VALUE str2) https://github.com/ruby/ruby/blob/trunk/string.c#L3447
  *    string <=> other_string -> -1, 0, 1, or nil
  *
  *  Compares +self+ and +other_string+, returning:
- *  - -1 if +other_string+ is smaller.
+ *  - -1 if +other_string+ is larger.
  *  - 0 if the two are equal.
- *  - 1 if +other_string+ is larger.
+ *  - 1 if +other_string+ is smaller.
  *  - +nil+ if the two are incomparable.
  *
  *  Examples:
@@ -3481,9 +3481,9 @@ static VALUE str_casecmp_p(VALUE str1, VALUE str2); https://github.com/ruby/ruby/blob/trunk/string.c#L3481
  *    str.casecmp(other_str) -> -1, 0, 1, or nil
  *
  *  Compares +self+ and +other_string+, ignoring case, and returning:
- *  - -1 if +other_string+ is smaller.
+ *  - -1 if +other_string+ is larger.
  *  - 0 if the two are equal.
- *  - 1 if +other_string+ is larger.
+ *  - 1 if +other_string+ is smaller.
  *  - +nil+ if the two are incomparable.
  *
  *  Examples:
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]