Merging of short lines