From 5ba27573a0d179d0a39d9997cfde000b20cd0b87 Mon Sep 17 00:00:00 2001
From: ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Sat, 25 Aug 2007 08:54:29 +0000
Subject: * string.c, include/ruby/intern.h: export rb_str_length(). *
 insns.def: use rb_str_lengt() in opt_length.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
---
 insns.def | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'insns.def')

diff --git a/insns.def b/insns.def
index 685f49f606..4a12a5b930 100644
--- a/insns.def
+++ b/insns.def
@@ -1951,11 +1951,11 @@ opt_length
 {
     if (!SPECIAL_CONST_P(recv) &&
 	BASIC_OP_UNREDEFINED_P(BOP_LENGTH)) {
-	if (HEAP_CLASS_OF(recv) == rb_cArray) {
-	    val = LONG2NUM(RARRAY_LEN(recv));
+	if (HEAP_CLASS_OF(recv) == rb_cString) {
+	    val = rb_str_length(recv);
 	}
-	else if (HEAP_CLASS_OF(recv) == rb_cString) {
-	    val = LONG2NUM(RSTRING_LEN(recv));
+	else if (HEAP_CLASS_OF(recv) == rb_cArray) {
+	    val = LONG2NUM(RARRAY_LEN(recv));
 	}
 	else if (HEAP_CLASS_OF(recv) == rb_cHash) {
 	    val = INT2FIX(RHASH(recv)->tbl->num_entries);
-- 
cgit v1.2.3

