mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
[python] migrate code to use Strings.areSameInstance instead of comparison operations (IDEA-312368)
This is needed to make the intention explicit and avoid warnings. GitOrigin-RevId: be902bbeea65827d6afcf41a6015d2107e3f5eb2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3db1e0326b
commit
b9055571c0
@@ -6,6 +6,7 @@ import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.util.text.Strings;
|
||||
import com.intellij.psi.util.QualifiedName;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.jetbrains.python.psi.PyStringLiteralCoreUtil;
|
||||
@@ -54,7 +55,7 @@ public final class PythonStringUtil {
|
||||
s = FileUtil.toSystemIndependentName(s);
|
||||
final List<String> components = StringUtil.split(s, "/");
|
||||
for (String name : components) {
|
||||
if (name == components.get(0) && SystemInfo.isWindows && name.endsWith(":")) {
|
||||
if (Strings.areSameInstance(name, components.get(0)) && SystemInfo.isWindows && name.endsWith(":")) {
|
||||
continue;
|
||||
}
|
||||
if (!PathUtil.isValidFileName(name)) {
|
||||
|
||||
Reference in New Issue
Block a user