utils/pypi: avoid creating new string objects
Co-authored-by: Markus Reiter <me@reitermark.us>
This commit is contained in:
parent
4bfb390577
commit
b3b6ce77d8
@ -91,7 +91,7 @@ module PyPI
|
|||||||
|
|
||||||
sig { params(other: Package).returns(T::Boolean) }
|
sig { params(other: Package).returns(T::Boolean) }
|
||||||
def same_package?(other)
|
def same_package?(other)
|
||||||
@name.downcase.tr("_", "-") == other.name.downcase.tr("_", "-")
|
@name.tr("_", "-").casecmp(other.name.tr("_", "-")).zero?
|
||||||
end
|
end
|
||||||
|
|
||||||
# Compare only names so we can use .include? on a Package array
|
# Compare only names so we can use .include? on a Package array
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user