shithub: mc

ref: 68a437bb6d370781e18ad1b794cc34c21dd5b361
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
}