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 );
// only perform parsing if the string contains a space
if ( / /.test( prop ) )
// the keywords are all words, except for the last, which is the
// property name
if ( ( keywords = prop.split( /\s+/ ) ).length !== 1 )
{
// the keywords are all words, except for the last, which is the
// property name
keywords = prop.split( /\s+/ );
name = keywords.pop();
name = keywords.pop();
var i = keywords.length,
keyword = '';