patch 9.0.1464: strace filetype detection is expensive

Problem:    Strace filetype detection is expensive.
Solution:   Match with a cheap pattern first. (Federico Mengozzi,
            closes #12220)
This commit is contained in:
Federico Mengozzi
2023-04-17 22:31:38 +01:00
committed by Bram Moolenaar
parent 4c42c7eef4
commit 6e5a9f9482
3 changed files with 11 additions and 1 deletions

View File

@ -338,7 +338,9 @@ def DetectFromText(line1: string)
set ft=virata
# Strace
elseif line1 =~ '[0-9:.]* *execve(' || line1 =~ '^__libc_start_main'
# inaccurate fast match first, then use accurate slow match
elseif (line1 =~ 'execve(' && line1 =~ '^[0-9:.]* *execve(')
|| line1 =~ '^__libc_start_main'
set ft=strace
# VSE JCL