shithub: mc

ref: 720cc29f19477550800adf5539837fec15296bbc
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
}