Show
Ignore:
Timestamp:
11/28/08 00:34:12 (6 weeks ago)
Author:
teramako
Message:

optimize completer's code

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/vimperator-plugins/trunk/copy.js

    r25054 r25152  
    9595            var candidates = []; 
    9696            var filter = context.filter.toLowerCase(); 
    97             templates.forEach(function(template){ 
    98                 if (template[0].toLowerCase().indexOf(filter) == 0) 
    99                     candidates.push(template); 
    100             }); 
    101             context.completions = candidates; 
     97            context.completions = templates.filter(function(template) template[0].toLowerCase().indexOf(filter) == 0); 
    10298        }, 
    10399        bang: true