Convert to boolean in C code

casecmp?(str) is 1.5x faster than casecmp(str).zero?
It's 1 less method call in Ruby, and the C code can convert
to boolean, rather than returning a number and determining
if it's zero.
This commit is contained in:
rubic0n
2021-02-17 23:25:10 -06:00
parent 0c7019f1e8
commit a623252c59
4 changed files with 8 additions and 8 deletions

View File

@@ -53,7 +53,7 @@ module JsonLdHelper
needle = Addressable::URI.parse(url).host
haystack = Addressable::URI.parse(@account.uri).host
!haystack.casecmp(needle).zero?
!haystack.casecmp?(needle)
end
def canonicalize(json)