File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Framework/SwiftOSC/Addresses Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -180,20 +180,24 @@ public struct OSCAddressPattern {
180
180
181
181
// Returns True if the address matches the address pattern.
182
182
public func matches( _ address: OSCAddress ) -> Bool {
183
- if address. string. range ( of: self . regex, options: . regularExpression) == nil {
184
- return false
185
- } else {
186
- return true
183
+ var maches = true
184
+ autoreleasepool {
185
+ if address. string. range ( of: self . regex, options: . regularExpression) == nil {
186
+ maches = false
187
+ }
187
188
}
189
+ return maches
188
190
}
189
191
190
192
// Returns True if the address is along the path of the address pattern
191
193
public func matches( path: OSCAddress ) -> Bool {
192
- if path. string. range ( of: self . regexPath, options: . regularExpression) == nil {
193
- return false
194
- } else {
195
- return true
194
+ var maches = true
195
+ autoreleasepool {
196
+ if path. string. range ( of: self . regexPath, options: . regularExpression) == nil {
197
+ maches = false
198
+ }
196
199
}
200
+ return maches
197
201
}
198
202
}
199
203
You can’t perform that action at this time.
0 commit comments