speed up for convert type implementation.

it is twice as fast!

```
$ bundle exec ruby test.rb
       user     system      total        real
   0.000000   0.000000   0.000000 (  0.000033)
   0.000000   0.000000   0.000000 (  0.000016)
```