mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 11:38:16 +00:00
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.
This commit is contained in:
parent
89608ef140
commit
c4a7de165c
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user