Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…eded coerce_to
  • Loading branch information...
commit e1b6562bf6a67fb8fd9382f50c1a3f5157f36c36 1 parent bbb18ed
Karol Hosiawa hosiawak authored
Showing with 0 additions and 1 deletion.
  1. +0 −1  kernel/common/string.rb
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
Please sign in to comment.
Something went wrong with that request. Please try again.