shithub: mc

ref: 58c27b2d8d021d485feb47aeb9744c7ae27d9112
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
}