I guess I can move this to the tutorials section, since this seems to work just fine:
Is this an acceptable way to do it?
B4X:
Sub BuffersEqual (b1() As Byte, b2() As Byte) As Boolean
If b1.Length <> b2.Length Then Return False
For i = 0 To b1.Length - 1
If b1(i) <> b2(i) Then Return False
Next
Return True
End Sub
'name this whatever you want!
Public Sub MapsAreSame(aMap as Map, bMap as Map) As Boolean
Dim ser As B4XSerializator
Dim am() As Byte = ser.ConvertObjectToBytes(aMap)
Dim bm() As Byte = ser.ConvertObjectToBytes(bMap)
Return BuffersEqual(am,bm)
End Sub
Is this an acceptable way to do it?
Last edited: