Remove unused parameter. Don't put check for g_network presence in ASSERT_WE_THINK.

This commit is contained in:
A.J. Beamon 2020-02-21 16:28:03 -08:00
parent 2431d4d788
commit dfa5f76c01
4 changed files with 9 additions and 6 deletions

View File

@ -1284,7 +1284,7 @@ ACTOR Future<Void> BgDDMountainChopper( DDQueueData* self, int teamCollectionInd
} }
traceEvent.detail("Moved", moved); traceEvent.detail("Moved", moved);
traceEvent.log(true); traceEvent.log();
} }
} }
@ -1381,7 +1381,7 @@ ACTOR Future<Void> BgDDValleyFiller( DDQueueData* self, int teamCollectionIndex)
} }
traceEvent.detail("Moved", moved); traceEvent.detail("Moved", moved);
traceEvent.log(true); traceEvent.log();
} }
} }

View File

@ -111,7 +111,7 @@ extern bool isAssertDisabled( int line );
// ASSERT_WE_THINK() is to be used for assertions that we want to validate in testing, but which are judged too // ASSERT_WE_THINK() is to be used for assertions that we want to validate in testing, but which are judged too
// risky to evaluate at runtime, because the code should work even if they are false and throwing internal_error() would // risky to evaluate at runtime, because the code should work even if they are false and throwing internal_error() would
// result in a bug. Don't use it for assertions that are *expensive*; look at EXPENSIVE_VALIDATION. // result in a bug. Don't use it for assertions that are *expensive*; look at EXPENSIVE_VALIDATION.
#define ASSERT_WE_THINK( condition ) ASSERT( !g_network || !g_network->isSimulated() || (condition) ) #define ASSERT_WE_THINK( condition ) ASSERT( !g_network->isSimulated() || (condition) )
#define ABORT_ON_ERROR( code_to_run ) \ #define ABORT_ON_ERROR( code_to_run ) \
try { code_to_run; } \ try { code_to_run; } \

View File

@ -978,7 +978,7 @@ TraceEvent& TraceEvent::backtrace(const std::string& prefix) {
return detail(prefix + "Backtrace", platform::get_backtrace()); return detail(prefix + "Backtrace", platform::get_backtrace());
} }
void TraceEvent::log(bool useCurrentTime) { void TraceEvent::log() {
if(!logged) { if(!logged) {
init(); init();
try { try {
@ -1327,6 +1327,9 @@ void TraceEventFields::validateFormat() const {
} }
std::string traceableStringToString(const char* value, size_t S) { std::string traceableStringToString(const char* value, size_t S) {
ASSERT_WE_THINK(S > 0 && value[S - 1] == '\0'); if(g_network) {
ASSERT_WE_THINK(S > 0 && value[S - 1] == '\0');
}
return std::string(value, S - 1); // Exclude trailing \0 byte return std::string(value, S - 1); // Exclude trailing \0 byte
} }

View File

@ -473,7 +473,7 @@ public:
return enabled; return enabled;
} }
void log(bool useCurrentTime = false); void log();
~TraceEvent(); // Actually logs the event ~TraceEvent(); // Actually logs the event