瀏覽代碼

Use match instead of find, minor performance gain

Zed 4 年之前
父節點
當前提交
759728e363
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/formatters.nim

+ 1 - 1
src/formatters.nim

@@ -56,7 +56,7 @@ proc replaceUrl*(url: string; prefs: Prefs; absolute=""): string =
 
 proc getM3u8Url*(content: string): string =
   var m: RegexMatch
-  if content.find(m3u8Regex, m):
+  if content.match(m3u8Regex, m):
     result = content[m.group(0)[0]]
 
 proc proxifyVideo*(manifest: string; proxy: bool): string =