mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-13 05:57:00 -04:00
Don't assert() check_tagged, that causes assert failures in debug mode for code that works in release
This commit is contained in:
@@ -774,7 +774,7 @@ void remove_from_stats(KeywordUsageStatistics* stat, const Value* stat_key) {
|
|||||||
|
|
||||||
String KeywordDatabase::expand(const String& text, KeywordExpandOptions const& options) const {
|
String KeywordDatabase::expand(const String& text, KeywordExpandOptions const& options) const {
|
||||||
assert(options.combine_script);
|
assert(options.combine_script);
|
||||||
assert_tagged(text);
|
assert_tagged(text, false);
|
||||||
|
|
||||||
// Clean up usage statistics
|
// Clean up usage statistics
|
||||||
remove_from_stats(options.stat, options.stat_key);
|
remove_from_stats(options.stat, options.stat_key);
|
||||||
@@ -794,7 +794,7 @@ String KeywordDatabase::expand(const String& text, KeywordExpandOptions const& o
|
|||||||
|
|
||||||
// Expand
|
// Expand
|
||||||
String result = expand_keywords(tagged, matches, options);
|
String result = expand_keywords(tagged, matches, options);
|
||||||
assert_tagged(result);
|
assert_tagged(result, false);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -226,7 +226,11 @@ String tagged_substr_replace(const String& input, size_t start, size_t end, cons
|
|||||||
*/
|
*/
|
||||||
bool check_tagged(const String& str, bool check_balance = true);
|
bool check_tagged(const String& str, bool check_balance = true);
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#define assert_tagged(...) assert(check_tagged(__VA_ARGS__))
|
#if 0
|
||||||
|
#define assert_tagged(...) assert(check_tagged(__VA_ARGS__))
|
||||||
|
#else
|
||||||
|
#define assert_tagged(...) check_tagged(__VA_ARGS__)
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#define assert_tagged(...) do{}while(0)
|
#define assert_tagged(...) do{}while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user