Bug 372298 - xpcom/io: 10K codesize reduction by fixing string array p=Alfred Kayser <alfredkayser@nl.ibm.com> r+a=bsmedberg

This commit is contained in:
asqueella@gmail.com 2007-09-02 14:57:11 -07:00
parent 8c98152cba
commit 5347590a4c

View File

@ -2291,7 +2291,7 @@ nsLocalFile::IsExecutable(PRBool *_retval)
*p += (*p >= L'A' && *p <= L'Z') ? 'a' - 'A' : 0;
// Search for any of the set of executable extensions.
const char * const executableExts[] = {
static const char * const executableExts[] = {
"ad",
"ade", // access project extension
"adp",
@ -2363,10 +2363,10 @@ nsLocalFile::IsExecutable(PRBool *_retval)
"ws",
"wsc",
"wsf",
"wsh",
0 };
for ( int i = 0; executableExts[i]; i++ ) {
if ( Substring(path, dotIdx + 1).EqualsASCII(executableExts[i])) {
"wsh"};
nsDependentSubstring ext = Substring(path, dotIdx + 1);
for ( int i = 0; i < NS_ARRAY_LENGTH(executableExts); i++ ) {
if ( ext.EqualsASCII(executableExts[i])) {
// Found a match. Set result and quit.
*_retval = PR_TRUE;
break;