From 002eb8c87cc87f36144b0e0f53385e2f3fb8beac Mon Sep 17 00:00:00 2001 From: Alex Sokol Date: Sat, 18 Feb 2023 00:45:46 +0300 Subject: [PATCH] Consistent behaviour independent on build host This is required since Telegram starts a new contest to improve UI for calls, so guys with MacOS or Linux wouldn't be distracted by this. --- .../org/telegram/messenger/Utilities.java | 29 ++----------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java b/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java index f129fa5d9..7e5312168 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java @@ -140,32 +140,9 @@ public class Utilities { if (value == null) { return 0; } - if (BuildConfig.BUILD_HOST_IS_WINDOWS) { - Matcher matcher = pattern.matcher(value); - if (matcher.find()) { - return Integer.valueOf(matcher.group()); - } - } else { - int val = 0; - try { - int start = -1, end; - for (end = 0; end < value.length(); ++end) { - char character = value.charAt(end); - boolean allowedChar = character == '-' || character >= '0' && character <= '9'; - if (allowedChar && start < 0) { - start = end; - } else if (!allowedChar && start >= 0) { - end++; - break; - } - } - if (start >= 0) { - String str = value.subSequence(start, end).toString(); -// val = parseInt(str); - val = Integer.parseInt(str); - } - } catch (Exception ignore) {} - return val; + Matcher matcher = pattern.matcher(value); + if (matcher.find()) { + return Integer.valueOf(matcher.group()); } return 0; }