shithub: mc

ref: 16b5ec849c2886329338f210cb4c90efc26c8b38
dir: /lib/std/hassuffix.myr/

View raw version
use "sleq"
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
}