avim icon indicating copy to clipboard operation
avim copied to clipboard

Stop using early returns?

Open 1ec5 opened this issue 11 years ago • 0 comments

In an effort to tame the original AVIM input engine code long ago, I replaced many complex, multiply-nested conditionals with opportunistic use of early returns. This approach is more useful in some parts of the code, like ckspell(), than in others. By a back-of-the-napkin estimate, converting avim.js to conform to structured programming style would save almost 2 kB. I wonder if we could refactor some of this code to eliminate the large branches that incentivize early returns.

1ec5 avatar Mar 06 '14 07:03 1ec5