about summary refs log tree commit diff
path: root/tvix/eval/src/chunk.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-12T14·26+0300
committertazjin <tazjin@tvl.su>2022-08-27T09·27+0000
commit0a09356f823f53044f92d44e04289d0f051cfc08 (patch)
tree0dd9b916ca424bf0935a60c5dadb0977bba88f54 /tvix/eval/src/chunk.rs
parent4c9d3fa2a6cd19ce0041d56e43c6f7ca958171e4 (diff)
refactor(tvix/eval): rename Chunk::add_* functions to ::push_* r/4513
grfn pointed out in cl/6069 that naming them like this makes it clear
that things are being added to the end of the state.

Change-Id: I6a23215c4fef713869a3c85b0dde1ebbda7637e9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6179
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'tvix/eval/src/chunk.rs')
-rw-r--r--tvix/eval/src/chunk.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/eval/src/chunk.rs b/tvix/eval/src/chunk.rs
index 3475e58f1870..e0b584fb1f98 100644
--- a/tvix/eval/src/chunk.rs
+++ b/tvix/eval/src/chunk.rs
@@ -8,13 +8,13 @@ pub struct Chunk {
 }
 
 impl Chunk {
-    pub fn add_op(&mut self, data: OpCode) -> CodeIdx {
+    pub fn push_op(&mut self, data: OpCode) -> CodeIdx {
         let idx = self.code.len();
         self.code.push(data);
         CodeIdx(idx)
     }
 
-    pub fn add_constant(&mut self, data: Value) -> ConstantIdx {
+    pub fn push_constant(&mut self, data: Value) -> ConstantIdx {
         let idx = self.constants.len();
         self.constants.push(data);
         ConstantIdx(idx)