commit:     e792576ae2be0ea2ef5adf29876369f69876be9b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 26 09:59:01 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Feb  3 08:36:48 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gentoo-syntax.git/commit/?id=e792576a

gentoo-common: Simplify adding other impls

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 plugin/gentoo-common.vim | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/plugin/gentoo-common.vim b/plugin/gentoo-common.vim
index 4c4c152..671a3c5 100644
--- a/plugin/gentoo-common.vim
+++ b/plugin/gentoo-common.vim
@@ -67,17 +67,16 @@ fun! GentooGetPythonTargets()
         if filereadable(l:pyexec_path)
             let l:pys = readfile(l:pyexec_path)->filter("v:val =~ '^[^#-]'")
                                              \ ->sort()
+            let l:impls = []
             let l:py3s = []
-            let l:others = []
             for l:py in l:pys
                 let l:m = l:py->matchstr("^python3.*")->matchstr("\\d*$")
                 if !empty(l:m)
                     eval l:py3s->add(l:m)
                 else
-                    eval l:others->add(l:py)
+                    eval l:impls->add(l:py)
                 endif
             endfor
-            let l:impls = []
             if len(l:py3s) ==# 1
                 let l:impls = l:impls->add("python3_".l:py3s->join())
             elseif len(l:py3s) > 1
@@ -104,7 +103,7 @@ fun! GentooGetPythonTargets()
                                        \ ->join(",")."}")
                 endif
             endif
-            let l:py3 = flatten(l:impls->add(l:others))->join()
+            let l:py3 = flatten(l:impls)->join()
         endif
         if empty(l:py3)
             let l:py3 =

Reply via email to