|
-
Apr 15th, 2022, 07:47 AM
#26
Re: Faster ByteArray search/loop
 Originally Posted by wqweto
Yes, in practice the performance is not so abysmal. For instance I use InStrB for byte-arrays equality comparison like this
Code:
Private Function pvArrayEqual(baFirst() As Byte, baSecond() As Byte) As Boolean
If pvArraySize(baFirst) = pvArraySize(baSecond) Then
pvArrayEqual = (InStrB(baFirst, baSecond) = 1)
End If
End Function
cheers,
</wqw>
IMO, faster should be a direct expression (avoiding the call-overhead to your Private Function):
If CStr(baFirst) = CStr(baSecond) Then ...
instead of:
If pvArrayEqual(baFirst, baSecond) Then ...
Olaf
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|