optimize LineAdjAlgorithm
Signed-off-by: Fan Yansu <yansufan@gmail.com>