one single pass to treat borders, instead of several loops. Slighly slower, but more uniform and readable code
Authored by: rmottola 2015-09-24
Parent: [r463]
Child: [r465]