Uh oh!
There was an error while loading. Please reload this page.
Rewrite IPAddr.new.include? with pure Ruby bit operation - #110
Conversation
knu
left a comment
There was a problem hiding this comment.
I'm not particularly in favor of implementing another IP address parser to maintain.
Leaving aside the maintenance cost, there would be concerns about regression and incompatibility. I think the new implementation has to be tested with all IP address patterns that IPAddr can handle in the test suite, and it also has to reject invalid addresses that IPAddr rejects.
knu
commented
Jul 28, 2024
Maybe this is not a strict requirement because it silently ignores any malformed address and returns false. |
hsbt
commented
Aug 1, 2024
@knu Thanks, I also agree your comment. I added only simple IPv4 and IPv6 pattern. I keep open this until another idea will be available. |
I want to reduce across stdlib dependencies. I remove
IPAddrand rewrite that to rough bit operation.