1
0
Fork 0

prop_parse no longer scans the string twice

The performance impact is negligable in either case.
perfodd
Mike Gerwitz 2014-01-19 11:48:37 -05:00
parent 72da8f2dee
commit 16d0641f46
1 changed files with 4 additions and 6 deletions

View File

@ -51,13 +51,11 @@ exports.parseKeywords = function ( prop )
prop = ''+( prop ); prop = ''+( prop );
// only perform parsing if the string contains a space // the keywords are all words, except for the last, which is the
if ( / /.test( prop ) ) // property name
if ( ( keywords = prop.split( /\s+/ ) ).length !== 1 )
{ {
// the keywords are all words, except for the last, which is the name = keywords.pop();
// property name
keywords = prop.split( /\s+/ );
name = keywords.pop();
var i = keywords.length, var i = keywords.length,
keyword = ''; keyword = '';