On Porter's decoding algorithm of algebraic-geometric codes