Bug 646597 - Remove unneeded #ifdef DEBUG: use DebugOnly instead; r=bhackett

Assignment to a DebugOnly variable results in a call to either the empty
'operator =' or to an empty implicit 1-arg constructor and empty copy
constructor when in non-debug mode.  Either of these get inlined and
eliminated as dead code above -00, so there is no benefit to skipping
this assignment for non-debug builds.
This commit is contained in:
Terrence Cole 2011-09-04 13:58:00 +01:00
Родитель 9cc503bb3d
Коммит 7e5208b4e8
2 изменённых файлов: 1 добавлений и 3 удалений

Просмотреть файл

@ -905,9 +905,7 @@ ScriptAnalysis::analyzeLifetimes(JSContext *cx)
ensureVariable(lifetimes[i], startOffset - 1);
}
#ifdef DEBUG
found = true;
#endif
break;
}
}

Просмотреть файл

@ -174,7 +174,7 @@ struct DebugOnly
#else
DebugOnly() {}
DebugOnly(const T&) {}
DebugOnly& operator=(const T&) {}
DebugOnly& operator=(const T&) { return *this; }
#endif
/*