shithub: mc

ref: eab5599e480cc900f86acca3d157ad670110d570
dir: /lib/std/hassuffix.myr/

View raw version
use "sleq.use"
pkg std =
	const hassuffix	: (s : byte[:], suff : byte[:] -> bool)
;;

const hassuffix = {s, suff
	var tail

	if suff.len <= s.len
		tail = s[s.len - suff.len:]
		-> sleq(tail, suff)
	;;
	-> false
}