Avoid costly GetScheme on nsSimpleURI, and avoid yet another "javascript:" string literal and the consequent PL_strcasecmp call, in favor of a fast NUL first-char test.
git-svn-id: svn://10.0.0.236/trunk@74143 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -298,11 +298,11 @@ public:
|
||||
|
||||
// If mURI is just "javascript:", we bring up the JavaScript console
|
||||
// and return NS_ERROR_DOM_RETVAL_UNDEFINED.
|
||||
nsXPIDLCString spec;
|
||||
rv = mURI->GetSpec(getter_Copies(spec));
|
||||
nsXPIDLCString script;
|
||||
rv = mURI->GetPath(getter_Copies(script));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (PL_strcasecmp(spec, "javascript:") == 0) {
|
||||
if (*((const char*)script) == '\0') {
|
||||
rv = evalProxy->BringUpConsole();
|
||||
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
|
||||
return NS_ERROR_DOM_RETVAL_UNDEFINED;
|
||||
|
||||
Reference in New Issue
Block a user