perf: Remove unused private field in `JSONSchema`
This commit is contained in:
parent
0aaff827b5
commit
691ec3e2ac
|
@ -2,6 +2,10 @@
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Performance
|
||||
|
||||
- Remove unused private field in `JSONSchema`, that lead to improvement in the compilation performance.
|
||||
|
||||
## [0.13.2] - 2021-11-04
|
||||
|
||||
### Added
|
||||
|
|
|
@ -19,7 +19,6 @@ use ahash::AHashMap;
|
|||
use context::CompilationContext;
|
||||
use options::CompilationOptions;
|
||||
use serde_json::Value;
|
||||
use std::sync::Arc;
|
||||
use url::Url;
|
||||
|
||||
pub(crate) const DEFAULT_ROOT_URL: &str = "json-schema:///";
|
||||
|
@ -27,7 +26,6 @@ pub(crate) const DEFAULT_ROOT_URL: &str = "json-schema:///";
|
|||
/// The structure that holds a JSON Schema compiled into a validation tree
|
||||
#[derive(Debug)]
|
||||
pub struct JSONSchema {
|
||||
pub(crate) schema: Arc<Value>,
|
||||
pub(crate) node: SchemaNode,
|
||||
pub(crate) resolver: Resolver,
|
||||
config: CompilationOptions,
|
||||
|
|
|
@ -270,7 +270,7 @@ impl CompilationOptions {
|
|||
None => DEFAULT_SCOPE.clone(),
|
||||
};
|
||||
let schema_json = Arc::new(schema.clone());
|
||||
let resolver = Resolver::new(draft, &scope, schema_json.clone(), self.store.clone())?;
|
||||
let resolver = Resolver::new(draft, &scope, schema_json, self.store.clone())?;
|
||||
let context = CompilationContext::new(scope.into(), &config);
|
||||
|
||||
if self.validate_schema {
|
||||
|
@ -287,7 +287,6 @@ impl CompilationOptions {
|
|||
let node = compile_validators(schema, &context)?;
|
||||
|
||||
Ok(JSONSchema {
|
||||
schema: schema_json,
|
||||
node,
|
||||
resolver,
|
||||
config,
|
||||
|
|
Loading…
Reference in New Issue