Permalink
Browse files

String#[] perf improved by 55% for the Fixnum case by removing not ne…

…eded coerce_to
  • Loading branch information...
1 parent bbb18ed commit e1b6562bf6a67fb8fd9382f50c1a3f5157f36c36 @hosiawak hosiawak committed Jun 19, 2011
Showing with 0 additions and 1 deletion.
  1. +0 −1 kernel/common/string.rb
View
@@ -258,7 +258,6 @@ def [](index, other = undefined)
# The same code as in else section.
# Copied here to improve performance because Fixnum index is
# often used to iterate through String object.
- index = Rubinius::Type.coerce_to index, Fixnum, :to_int
index = @num_bytes + index if index < 0
return if index < 0 || @num_bytes <= index

0 comments on commit e1b6562

Please sign in to comment.