shithub: mc

ref: 4db5274a2f6db10e31e11c503f36c85a98c65fbc
dir: /lib/std/hassuffix.myr/

View raw version
use "traits"
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:]
		-> eq(tail, suff)
	;;
	-> false
}