Skip to content

Commit 8c0b34d

Browse files
committed
entries -> raw_table
1 parent c8a6f5e commit 8c0b34d

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

src/table/table.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,16 @@ impl<'gc> Table<'gc> {
3636

3737
pub fn from_parts(
3838
mc: &Mutation<'gc>,
39-
entries: RawTable<'gc>,
39+
raw_table: RawTable<'gc>,
4040
metatable: Option<Table<'gc>>,
4141
) -> Table<'gc> {
42-
Self(Gc::new(mc, RefLock::new(TableState { entries, metatable })))
42+
Self(Gc::new(
43+
mc,
44+
RefLock::new(TableState {
45+
raw_table,
46+
metatable,
47+
}),
48+
))
4349
}
4450

4551
pub fn from_inner(inner: Gc<'gc, TableInner<'gc>>) -> Self {
@@ -64,7 +70,7 @@ impl<'gc> Table<'gc> {
6470
}
6571

6672
pub fn get_value(self, key: Value<'gc>) -> Value<'gc> {
67-
self.0.borrow().entries.get(key)
73+
self.0.borrow().raw_table.get(key)
6874
}
6975

7076
pub fn set_value(
@@ -73,7 +79,7 @@ impl<'gc> Table<'gc> {
7379
key: Value<'gc>,
7480
value: Value<'gc>,
7581
) -> Result<Value<'gc>, InvalidTableKey> {
76-
self.0.borrow_mut(&mc).entries.set(key, value)
82+
self.0.borrow_mut(&mc).raw_table.set(key, value)
7783
}
7884

7985
/// Returns a 'border' for this table.
@@ -84,7 +90,7 @@ impl<'gc> Table<'gc> {
8490
/// If a table has exactly one border, it is called a 'sequence', and this border is the table's
8591
/// length.
8692
pub fn length(self) -> i64 {
87-
self.0.borrow().entries.length()
93+
self.0.borrow().raw_table.length()
8894
}
8995

9096
/// Returns the next value after this key in the table order.
@@ -98,7 +104,7 @@ impl<'gc> Table<'gc> {
98104
/// in the table, it will return the next pair in iteration order. If given a key that is not
99105
/// present in the table, the behavior is unspecified.
100106
pub fn next(self, key: Value<'gc>) -> NextValue<'gc> {
101-
self.0.borrow().entries.next(key)
107+
self.0.borrow().raw_table.next(key)
102108
}
103109

104110
/// Iterate over the key-value pairs of the table.
@@ -163,6 +169,6 @@ impl<'gc> IntoIterator for Table<'gc> {
163169
#[derive(Debug, Collect)]
164170
#[collect(no_drop)]
165171
pub struct TableState<'gc> {
166-
pub entries: RawTable<'gc>,
172+
pub raw_table: RawTable<'gc>,
167173
pub metatable: Option<Table<'gc>>,
168174
}

src/thread/vm.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ pub(super) fn run_vm<'gc>(
116116
array_size,
117117
map_size,
118118
} => {
119-
let mut entries = RawTable::new(&ctx);
120-
entries.reserve_array(array_size as usize);
121-
entries.reserve_map(map_size as usize);
122-
let table = Table::from_parts(&ctx, entries, None);
119+
let mut raw_table = RawTable::new(&ctx);
120+
raw_table.reserve_array(array_size as usize);
121+
raw_table.reserve_map(map_size as usize);
122+
let table = Table::from_parts(&ctx, raw_table, None);
123123
registers.stack_frame[dest.0 as usize] = Value::Table(table);
124124
}
125125

0 commit comments

Comments
 (0)