Hey everyone
My performance bottleneck of my ruby script is the following method:
Code:
def ip_to_int(ip)
bytes = ip.split('.')
return (bytes[0].to_i*16777216+bytes[1].to_i*65536+bytes[2].to_i*256+bytes[3].to_i)
end
Can anyone think of any ways to optimize it for runtime?
Thanks!
George