Add "Replace with 'equals(..., ignoreCase = true)'" inspection
#KT-40016 Fixed
This commit is contained in:
committed by
Vladimir Dolzhenko
parent
a5bfa3ae63
commit
d2deff4864
@@ -0,0 +1,16 @@
|
||||
<html>
|
||||
<body>
|
||||
This inspection reports case insensitive comparison that can be replaced with <b>equals(..., ignoreCase = true)</b>.
|
||||
By using <b>equals()</b> you won't have to allocate any extra strings with <b>toLowerCase()/toUpperCase()</b> to do the comparison.
|
||||
<br><br>
|
||||
For example:
|
||||
<br>
|
||||
<pre>
|
||||
fun main() {
|
||||
val a = "KoTliN"
|
||||
val b = "KOTLIN"
|
||||
println(a.toLowerCase() == b.toLowerCase()) // can be replaced with "a.equals(b, ignoreCase = true)"
|
||||
}
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2245,6 +2245,7 @@ title.packages.to.use.import.with=Packages to Use Import with '*'
|
||||
redundant.qualifier.unnecessary.non.direct.parent.class.qualifier=Unnecessary non-direct parent classes qualifiers
|
||||
fix.add.exception.to.throws=Add ''{0}''
|
||||
fix.add.eq.eq.true=Add '== true'
|
||||
inspection.replace.with.ignore.case.equals.display.name=Replace with 'equals(..., ignoreCase = true)'
|
||||
|
||||
hints.title.codevision=Code Vision
|
||||
hints.title.codevision.show.hints.for=Show hints for:
|
||||
|
||||
Reference in New Issue
Block a user