From 07bb522fba217d9511efacd2038ab24523459677 Mon Sep 17 00:00:00 2001 From: ACTCD <101378590+ACTCD@users.noreply.github.com> Date: Sat, 10 Jan 2026 00:16:19 +0000 Subject: [PATCH 1/2] fix: significantly reduces memory usage Avoid compiling RE repeatedly in loops, especially in large metadata scripts. --- xcode/Ext-Safari/Functions.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xcode/Ext-Safari/Functions.swift b/xcode/Ext-Safari/Functions.swift index ef3c887a..144abde1 100644 --- a/xcode/Ext-Safari/Functions.swift +++ b/xcode/Ext-Safari/Functions.swift @@ -158,18 +158,18 @@ func parse(_ content: String) -> [String: Any]? { var metadata = [:] as [String: [String]] // iterate through the possible metadata keys in file if let metas = Range(match.range(at: g2), in: content) { + let p = #"^(?:[ \t]*(?:\/\/)?[ \t]*@)([\w-]+)[ \t]+([^\s]+[^\r\n\t\v\f]*)"# + // this pattern checks for specific keys that won't have values + let p2 = #"^(?:[ \t]*(?:\/\/)?[ \t]*@)(noframes)[ \t]*$"# + // force try b/c pattern is known to be valid regex + let re = try! NSRegularExpression(pattern: p, options: []) + let re2 = try! NSRegularExpression(pattern: p2, options: []) // split metadatas by new line let metaArray = content[metas].split(whereSeparator: \.isNewline) // loop through metadata lines and populate metadata dictionary for meta in metaArray { - let p = #"^(?:[ \t]*(?:\/\/)?[ \t]*@)([\w-]+)[ \t]+([^\s]+[^\r\n\t\v\f]*)"# - // this pattern checks for specific keys that won't have values - let p2 = #"^(?:[ \t]*(?:\/\/)?[ \t]*@)(noframes)[ \t]*$"# // the individual meta string, ie. // @name File Name let metaString = String(meta).trimmingCharacters(in: .whitespaces) - // force try b/c pattern is known to be valid regex - let re = try! NSRegularExpression(pattern: p, options: []) - let re2 = try! NSRegularExpression(pattern: p2, options: []) let range = NSRange(location: 0, length: metaString.utf16.count) // key lines not properly prefixed & without values will be skipped if let m = re.firstMatch(in: metaString, options: [], range: range) { From dde98697858b38649faf21959eed720a84d69123 Mon Sep 17 00:00:00 2001 From: ACTCD <101378590+ACTCD@users.noreply.github.com> Date: Sat, 10 Jan 2026 00:36:26 +0000 Subject: [PATCH 2/2] build(release): v4.8.5, v1.8.5 --- xcode/xcconfig/Userscripts-Release.xcconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xcode/xcconfig/Userscripts-Release.xcconfig b/xcode/xcconfig/Userscripts-Release.xcconfig index cd823d30..9555c1cc 100644 --- a/xcode/xcconfig/Userscripts-Release.xcconfig +++ b/xcode/xcconfig/Userscripts-Release.xcconfig @@ -1,8 +1,8 @@ #include "Userscripts-Base.xcconfig" -INFOPLIST_KEY_NSHumanReadableCopyright = Copyright © 2018–2025 Justin Wasack. All rights reserved. -IOS_APP_VERSION = 1.8.4 -MAC_APP_VERSION = 4.8.4 +INFOPLIST_KEY_NSHumanReadableCopyright = Copyright © 2018–2026 Justin Wasack. All rights reserved. +IOS_APP_VERSION = 1.8.5 +MAC_APP_VERSION = 4.8.5 // Distribution CODE_SIGN_STYLE = Manual