Return the first occurence of self in b starting at from, or -1 if not found

Property definitions

core $ BytePattern :: first_index_in_from
	# Return the first occurence of `self` in `b` starting at `from`, or -1 if not found
	fun first_index_in_from(b: SequenceRead[Int], from: Int): Int is abstract
lib/core/bytes.nit:27,2--28,74

core :: bytes $ Int :: first_index_in_from
	redef fun first_index_in_from(b, from) do
		for i in [from .. b.length[ do if b[i] == self then return i
		return -1
	end
lib/core/bytes.nit:108,2--111,4

core $ Bytes :: first_index_in_from
	redef fun first_index_in_from(b, from) do
		if is_empty then return -1
		var fst = self[0]
		var bpos = fst.first_index_in_from(self, from)
		for i in [0 .. length[ do
			if self[i] != b[bpos] then return first_index_in_from(b, bpos + 1)
			bpos += 1
		end
		return bpos
	end
lib/core/bytes.nit:620,2--629,4