commit d78e5ed5ce0f7da6011e01791b8a98a3fd7fa61c
Author: leszek <leszek@koltunski.pl>
Date:   Mon Dec 1 00:49:31 2025 +0100

    get rid of java.util.regex import

diff --git a/src/main/java/org/distorted/library/main/DistortedLibrary.kt b/src/main/java/org/distorted/library/main/DistortedLibrary.kt
index 24ff122..db2251b 100644
--- a/src/main/java/org/distorted/library/main/DistortedLibrary.kt
+++ b/src/main/java/org/distorted/library/main/DistortedLibrary.kt
@@ -51,7 +51,6 @@ import java.io.InputStream
 import java.nio.ByteBuffer
 import java.nio.ByteOrder
 import java.nio.FloatBuffer
-import java.util.regex.Pattern
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
@@ -937,35 +936,20 @@ object DistortedLibrary
 
         if( driverVendor!!.contains("ARM") )
         {
-            try
-            {
-                val regex = ".*r(\\d+)p\\d.*"
-                val pattern = Pattern.compile(regex)
-                val matcher = pattern.matcher(driverVersion!!)
-
-                if (matcher.find())
-                {
-                    val driverVersion = matcher.group(1)
-
-                    if (driverVersion!=null)
-                    {
-                        val drvVersion = driverVersion.toInt()
-
-                        if (drvVersion<22)
-                        {
-                            mUser.logMessage("""
-    You are running this on a ARM Mali driver r$driverVersion.
-    This is a buggy driver, please update to r22. Inserting workaround which uses a lot of memory.
-    """.trimIndent())
-
-                            DistortedLibrary.queueSize = queueSize
-                        }
-                    }
-                }
-            }
-            catch (ex: Exception)
-            {
-                mUser.logMessage("DistortedLibrary: exception trying to pattern match version: $ex")
+            val regex = ".*r(\\d+)p\\d.*".toRegex()
+            val match = regex.find(driverVersion ?: "")
+
+            match?.groupValues?.get(1)?.toIntOrNull()?.let { drvVersion ->
+              if (drvVersion < 22)
+              {
+                mUser.logMessage("""
+                    You are running this on an ARM Mali driver r$drvVersion.
+                    This is a buggy driver, please update to r22. Inserting workaround which uses a lot of memory.
+                    """.trimIndent()
+                )
+
+                DistortedLibrary.queueSize = queueSize
+              }
             }
         }
         else if ( driverVendor!!.contains("Imagination") )
