refactor(tvix/eval): rename Value::NotFound & OpAttrOrNotFound

grfn suggested clearer naming for these in cl/6166.

Change-Id: I83164bf1d1902ebd42272e9d5d63819a0f6a72c5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6277
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2022-08-26 18:40:55 +03:00 committed by tazjin
parent 903b57be04
commit 7da5076191
4 changed files with 10 additions and 10 deletions

View file

@ -225,15 +225,15 @@ impl VM {
}
}
OpCode::OpAttrOrNotFound => {
OpCode::OpAttrsTrySelect => {
let key = self.pop().to_string()?;
let value = match self.pop() {
Value::Attrs(attrs) => match attrs.select(key.as_str()) {
Some(value) => value.clone(),
None => Value::NotFound,
None => Value::AttrNotFound,
},
_ => Value::NotFound,
_ => Value::AttrNotFound,
};
self.push(value);
@ -283,7 +283,7 @@ impl VM {
}
OpCode::OpJumpIfNotFound(offset) => {
if matches!(self.peek(0), Value::NotFound) {
if matches!(self.peek(0), Value::AttrNotFound) {
self.pop();
self.frame_mut().ip += offset;
}