源代码:
suffix(Suffix, List) ->
Delta = length(List) - length(Suffix),
Delta >= 0 andalso nthtail(Delta, List) =:= Suffix.
像下面这样重写它怎么样:
suffix(Suffix, List) ->
prefix(reverse(Suffix), reverse(List)).
如果Delta >=0,第一个遍历4次,第二个遍历3次,对吗?