1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
matz 2007-02-23 01:21:49 +00:00
parent 4563573a6b
commit 0c882f4c9d
3 changed files with 8 additions and 8 deletions

View file

@ -1,3 +1,8 @@
Fri Feb 23 10:03:49 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_ord): need not to check string length; ord
returns a codepoint for the first character in the string.
Wed Feb 21 22:29:45 2007 Akinori MUSHA <knu@iDaemons.org>
* numeric.c (fix_equal): A bit more optimization.

View file

@ -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);
}

View file

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
#define RUBY_RELEASE_DATE "2007-02-21"
#define RUBY_RELEASE_DATE "2007-02-23"
#define RUBY_VERSION_CODE 190
#define RUBY_RELEASE_CODE 20070221
#define RUBY_RELEASE_CODE 20070223
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 2
#define RUBY_RELEASE_DAY 21
#define RUBY_RELEASE_DAY 23
RUBY_EXTERN const char ruby_version[];
RUBY_EXTERN const char ruby_release_date[];