question

Erik Gerritse avatar image
0 Likes"
Erik Gerritse asked Mischa Spelt commented

Does the Array.IndexOf() method work for finding the position of another Array?

Hi everyone,

I am trying to use the Array.indexOf() command to check if an array (P) is an element of another array (P_all). When I test this the method always returns -1, even if I have explicitly added P to P_all before. Am I doing something wrong?

arrayarray index
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

anthony.johnson avatar image
2 Likes"
anthony.johnson answered Mischa Spelt commented

Yeah, this doesn't work. We will discuss on our side how/if we should change this. The question we are not sure on is whether the matching should check if the two compared arrays share the same pointer (since arrays are "pass by reference" shared pointers), or if the matching algorithm should check that all array elements are the same. I kind of lean toward the simple shared pointer check, but others here in the office disagree with me.

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.