prop_parse no longer scans the string twice
The performance impact is negligable in either case.perfodd
parent
72da8f2dee
commit
16d0641f46
|
@ -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 = '';
|
||||||
|
|
Loading…
Reference in New Issue