WithCachedASTValue can be called if the subject is static. This will compute the ast value once and cache it for future calls.
()
| 131 | // WithCachedASTValue can be called if the subject is static. This will compute |
| 132 | // the ast value once and cache it for future calls. |
| 133 | func (s Subject) WithCachedASTValue() Subject { |
| 134 | tmp := s |
| 135 | v, err := tmp.regoValue() |
| 136 | if err == nil { |
| 137 | tmp.cachedASTValue = v |
| 138 | } |
| 139 | return tmp |
| 140 | } |
| 141 | |
| 142 | func (s Subject) Equal(b Subject) bool { |
| 143 | if s.ID != b.ID { |