Skip to content

Commit 4b3d7c2

Browse files
authored
Merge pull request Tencent#1506 from ylavic/CreatePattern
Add missing curly brackets in STDREGEX's CreatePattern().
2 parents 01950eb + 94fc463 commit 4b3d7c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/rapidjson/schema.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,14 +1149,15 @@ class Schema {
11491149
#elif RAPIDJSON_SCHEMA_USE_STDREGEX
11501150
template <typename ValueType>
11511151
RegexType* CreatePattern(const ValueType& value) {
1152-
if (value.IsString())
1152+
if (value.IsString()) {
11531153
RegexType *r = static_cast<RegexType*>(allocator_->Malloc(sizeof(RegexType)));
11541154
try {
11551155
return new (r) RegexType(value.GetString(), std::size_t(value.GetStringLength()), std::regex_constants::ECMAScript);
11561156
}
11571157
catch (const std::regex_error&) {
11581158
AllocatorType::Free(r);
11591159
}
1160+
}
11601161
return 0;
11611162
}
11621163

0 commit comments

Comments
 (0)