Summary:
Use FOLLY_SAFE_DCHECK() rather than assert() to avoid compiler errors about
this variable being unused in builds where assert() statements are disabled.
Reviewed By: bolinfest, yfeldblum
Differential Revision:
D6421978
fbshipit-source-id:
ab1019fa1fa420856e1bf3bc39c441662c4efd75
#include <folly/dynamic.h>
#include <folly/experimental/logging/LogName.h>
#include <folly/json.h>
#include <folly/dynamic.h>
#include <folly/experimental/logging/LogName.h>
#include <folly/json.h>
+#include <folly/lang/SafeAssert.h>
#include <cassert>
using std::shared_ptr;
#include <cassert>
using std::shared_ptr;
auto emplaceResult =
categoryConfigs.emplace(canonicalName, std::move(categoryConfig));
auto emplaceResult =
categoryConfigs.emplace(canonicalName, std::move(categoryConfig));
- assert(emplaceResult.second);
+ FOLLY_SAFE_DCHECK(
+ emplaceResult.second,
+ "category name must be new since it was not in seenCategories");
}
return categoryConfigs;
}
return categoryConfigs;