Commits

ZyX_I committed 1c4b0ed

@aurum/log: Minor optimizations to hg logger (earned less then two seconds out of 104,73)

  • Participants
  • Parent commits 1fab447

Comments (0)

Files changed (1)

plugin/aurum/log.vim

     endif
     let knownparents=[]
     let newparents=[]
-    for parenthex in a:parents
-        call add(((index(a:seen, parenthex)==-1)?
-                    \   (newparents):
-                    \   (knownparents)),
-                    \parenthex)
-    endfor
+    call map(copy(a:parents), 'add(((index(a:seen, v:val)==-1)?'.
+                    \               '(newparents):'.
+                    \               '(knownparents)), '.
+                    \             'v:val)')
     let ncols=len(a:seen)
     call remove(a:seen, nodeidx)
     call extend(a:seen, newparents, nodeidx)
             if start>end
                 let [start, end]=[end, start]
             endif
-            for i in range(2*start+1, 2*end-1)
-                if a:nodeline[i] isnot# '+'
-                    let a:nodeline[i]='-'
-                endif
+            for i in filter(range(2*start+1, 2*end-1),
+                        \   'a:nodeline[v:val] isnot# "+"')
+                let a:nodeline[i]='-'
             endfor
         endif
     endfor