summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-23 01:21:49 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-23 01:21:49 +0000
commit0c882f4c9d8115d5292c85aacc4860e8946661fb (patch)
tree3c211a650fce15a03d596a5eba23754b10a34081 /string.c
parent4563573a6b762eab0acf96427d9d3b6f1d0c702f (diff)
* string.c (rb_str_ord): need not to check string length; ord
returns a codepoint for the first character in the string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/string.c b/string.c
index 17e3927812..5ce8d73e30 100644
--- a/string.c
+++ b/string.c
@@ -4249,11 +4249,6 @@ rb_str_ord(VALUE s)
{
int c;
- if (RSTRING_LEN(s) != 1) {
- rb_raise(rb_eTypeError,
- "expected a character, but string of size %ld given",
- RSTRING_LEN(s));
- }
c = RSTRING_PTR(s)[0] & 0xff;
return INT2NUM(c);
}