I have this function to find an element in an array:

```
function my_findfirst(element,array)
for i=1:length(array)
if @inbounds (array[i]==element)
return i
end
end
return nothing
end
```

I’ve created this function to make it faster than `findfirst`

, and it is already faster for some types:

```
N=100_000_000
array=zeros(Float64,N)
array[N÷2]=1.0
#first time run to compile
findfirst(isequal(1.0),array)
my_findfirst(1.0,array)
@time findfirst(isequal(1.0),array)
#0.143356 seconds (6 allocations: 192 bytes)
@time my_findfirst(1.0,array)
#0.079413 seconds (5 allocations: 176 bytes)
```

But for UInt8 is much slower:

```
N=100_000_000
array=zeros(UInt8,N)
array[N÷2]=UInt8(1)
#first time run to compile
findfirst(isequal(UInt8(1)),array)
my_findfirst(UInt8(1),array)
@time findfirst(isequal(UInt8(1)),array)
#0.008938 seconds (6 allocations: 192 bytes)
@time my_findfirst(UInt8(1),array)
#0.046022 seconds (5 allocations: 176 bytes)
```

So I see that there is some room to optimize

Could you help me to make it faster please?

Thanks in advance!