Remove Schema::Property::typeless member variable
This commit is contained in:
parent
4335a62219
commit
332c226f5e
@ -382,6 +382,7 @@ public:
|
|||||||
for (SizeType i = 0; i < propertyCount_; i++) {
|
for (SizeType i = 0; i < propertyCount_; i++) {
|
||||||
new (&properties_[i]) Property();
|
new (&properties_[i]) Property();
|
||||||
properties_[i].name = allProperties[i];
|
properties_[i].name = allProperties[i];
|
||||||
|
properties_[i].schema = GetTypeless();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -390,10 +391,8 @@ public:
|
|||||||
PointerType q = p.Append("properties");
|
PointerType q = p.Append("properties");
|
||||||
for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) {
|
for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) {
|
||||||
SizeType index;
|
SizeType index;
|
||||||
if (FindPropertyIndex(itr->name, &index)) {
|
if (FindPropertyIndex(itr->name, &index))
|
||||||
document->CreateSchema(&properties_[index].schema, q.Append(itr->name), itr->value);
|
document->CreateSchema(&properties_[index].schema, q.Append(itr->name), itr->value);
|
||||||
properties_[index].typeless = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -717,14 +716,13 @@ public:
|
|||||||
|
|
||||||
SizeType index;
|
SizeType index;
|
||||||
if (FindPropertyIndex(str, len, &index)) {
|
if (FindPropertyIndex(str, len, &index)) {
|
||||||
const SchemaType* propertySchema = properties_[index].typeless ? GetTypeless() : properties_[index].schema;
|
|
||||||
if (context.patternPropertiesSchemaCount > 0) {
|
if (context.patternPropertiesSchemaCount > 0) {
|
||||||
context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = propertySchema;
|
context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = properties_[index].schema;
|
||||||
context.valueSchema = GetTypeless();
|
context.valueSchema = GetTypeless();
|
||||||
context.valuePatternValidatorType = Context::kPatternValidatorWithProperty;
|
context.valuePatternValidatorType = Context::kPatternValidatorWithProperty;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
context.valueSchema = propertySchema;
|
context.valueSchema = properties_[index].schema;
|
||||||
|
|
||||||
if (properties_[index].required)
|
if (properties_[index].required)
|
||||||
context.objectRequiredCount++;
|
context.objectRequiredCount++;
|
||||||
@ -1059,14 +1057,13 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct Property {
|
struct Property {
|
||||||
Property() : schema(), dependenciesSchema(), dependencies(), required(false), typeless(true) {}
|
Property() : schema(), dependenciesSchema(), dependencies(), required(false) {}
|
||||||
~Property() { AllocatorType::Free(dependencies); }
|
~Property() { AllocatorType::Free(dependencies); }
|
||||||
SValue name;
|
SValue name;
|
||||||
const SchemaType* schema;
|
const SchemaType* schema;
|
||||||
const SchemaType* dependenciesSchema;
|
const SchemaType* dependenciesSchema;
|
||||||
bool* dependencies;
|
bool* dependencies;
|
||||||
bool required;
|
bool required;
|
||||||
bool typeless;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PatternProperty {
|
struct PatternProperty {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user