-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
encoding/jsonschema: do not return state from schemaState
As part of the schema reference refactoring, we'd like the freedom to return an arbitrary thing from the `state.schema` method, It's not immediately clear how much of the state value returned by `schemaState` is actually used by callers, so make that clearer by separating the concerns: a caller of `schemaState` can now only see information about the schema as chosen by `schemaState`, but not the underlying state itself. This is a little less efficient, as we now compute `hasConstraints` for every schema and also return the info by value rather than by reference, but the cost isn't great and it will keep us honest during this refactoring process. We can optimize later if needed. Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: I7202b6ab24d0e870dd93bdd0369f47bcdb8353e5 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1204953 TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
- Loading branch information
Showing
2 changed files
with
54 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters