shithub: mc

ref: 49f6758a734dc98ed7764d2f2ff8dfb77d4c75b0
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
}