]> git.wincent.com - pinnacle.git/commitdiff
Use `empty` instead of `==`
authorGreg Hurrell <greg@hurrell.net>
Thu, 8 Jun 2017 01:44:24 +0000 (18:44 -0700)
committerGreg Hurrell <greg@hurrell.net>
Thu, 8 Jun 2017 01:44:24 +0000 (18:44 -0700)
Arguably more transparent, and avoids questions about list equality in
VimL compared with other languages (eg. JavaScript, which isn't
referentially transparent, so `[] != []`).

autoload/pinnacle.vim

index 1e4d40337c058c2554a62fedae0505df9e8677d5..bcbeb19fa9137d7f5b0454f21c420f426ef533f0 100644 (file)
@@ -238,7 +238,7 @@ function! pinnacle#decorate(style, group) abort
       \   '\(' . l:lhs . '=[^ ]\+\)' .
       \   '\(\%( [^ ]\+\)*\)$'
       \ )
-    if l:matches == []
+    if empty(l:matches)
       " No setting, add one with just a:style in it
       let l:original .= ' ' . l:lhs . '=' . a:style
     else