turn regex into cycle (PY-13850)
authorAlexander Marchuk <Alexander.Marchuk@jetbrains.com>
Thu, 11 Sep 2014 11:55:59 +0000 (15:55 +0400)
committerAlexander Marchuk <Alexander.Marchuk@jetbrains.com>
Thu, 11 Sep 2014 11:55:59 +0000 (15:55 +0400)
python/pydevSrc/com/jetbrains/python/debugger/PyDebugValue.java

index ddec6797ea8dcc6019b066473815ac8fa523efea..26f81dddf56a56a4422ac917f9a9a3faa906d746 100644 (file)
@@ -124,7 +124,10 @@ public class PyDebugValue extends XNamedValue {
 
   private static String removeLeadingZeros(@NotNull String name) {
     //bugs.python.org/issue15254: "0" prefix for octal
-    return name.replaceFirst("^0+(?!$)", "");
+    while (name.length() > 1 && name.startsWith("0")) {
+      name = name.substring(1);
+    }
+    return name;
   }
 
   private static boolean isLen(String name) {