tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.1k stars 383 forks source link

Remove unused 'format' variable. #509

Closed thisduck closed 6 years ago

thisduck commented 6 years ago

It is no longer used in the function since commit 2d6558125cce7fcf1740d58870bda04eb66d3851.

I came across this while profiling gf on a very large ruby file (> 5000 lines). It was taking over 8 seconds. Turns out that the format function ends up calling the readable_line_count function > 5000 times, taking about 4 seconds in total. And the buffer_getline function also ended up being called about 20,000 times taking about 4 seconds as well.

Removing the storage of this unused variable seems to deflect the issue.

Please let me know if anything else needs to be done to get this merged. Thanks!