Elseif - remove ugly loop
minor #514 Elseif - remove ugly loop (keradus)

This PR was merged into the 1.0.x-dev branch.

Discussion
----------

Elseif - remove ugly loop

Commits
-------

cd13701 Elseif - remove ugly loop