[RFC] Spliting two-iteration loops in slang_clear()

This should be a trivial refactor. But I don't want to do pull request together with any other issues.