Skip to content

Commit

Permalink
cue/errors: make wrapped.Path faster by bypassing unnecessary reflection
Browse files Browse the repository at this point in the history
This makes one of our cue cmd runs noticeably faster, from ~52s to ~36s.

Change-Id: I735875bfcd8b08f329a59a903d4c7c1ae195f269
Signed-off-by: Maximilian Gaß <[email protected]>
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1198494
TryBot-Result: CUEcueckoo <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
  • Loading branch information
mxey authored and mvdan committed Jul 26, 2024
1 parent 055405a commit e68bd63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cue/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (e *wrapped) Msg() (format string, args []interface{}) {
}

func (e *wrapped) Path() []string {
if p := Path(e.main); p != nil {
if p := e.main.Path(); p != nil {
return p
}
return Path(e.wrap)
Expand Down

0 comments on commit e68bd63

Please sign in to comment.