shithub: mc

ref: 5106fe5edb4664688fe87b6340b32c0c1dbd6157
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
}