justinfrench/formtastic — pull request #1083 by timoschilling (2014-10-09 01:28:06+00:00)
Title: Update input_helper.rb

It's faster to don't check the type!
```ruby
Benchmark.bm(30) do |x|
[:foo, "bar"].each do |method|
x.report("with check and type #{method.class}:") { 100_000.times { method.to_sym if method.is_a?(String) } }
x.report("without check and type #{method.class}:") { 100_000.times { method.to_sym } }
end
end
```
```
user system total real
with check and type Symbol: 0.010000 0.000000 0.010000 ( 0.011005)
without check and type Symbol: 0.010000 0.000000 0.010000 ( 0.007977)
with check and type String: 0.020000 0.000000 0.020000 ( 0.017717)
without check and type String: 0.010000 0.000000 0.010000 ( 0.012937)
```

`Symbol#to_sym` is just a `return self`, `Object#is_a?` is quite more!