How to check two `Array` instances for identity equality in constant time?

That highlights that the type should be able saying the first word if it's identical or not.

BTW, what's your view on Jordans comment? I believe it's equally important to support that ("definitely not equal") in addition to the discussed "definitely equal".

I think we could only compare the first bytes till there's a difference, so for some InlineArray<1_000_000_000, Int> we will know the answer after comparing the first element and for some only when comparing all elements.

BTW the way you put is like saying that "for every concrete N, comparing two strings of length N is O(1)" :grinning_face:

Sure, O(1_000_000_000) == 1_000_000_000 * O(1) == O(1) ....

But that "1_000_000_000" is "N"... no? Looks like O(N) operation to me.

3 Likes