Remove outer RefCell from PyObjectRef

This commit is contained in:
Joey Hain
2019-02-25 19:01:01 -08:00
parent 027a6847e5
commit f10fa6db44
33 changed files with 380 additions and 425 deletions

View File

@@ -31,7 +31,6 @@ fn frame_flocals(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
arg_check!(vm, args, required = [(frame, Some(vm.ctx.frame_type()))]);
let frame = get_value(frame);
let py_scope = frame.locals.clone();
let py_scope = py_scope.borrow();
if let PyObjectPayload::Scope { scope } = &py_scope.payload {
Ok(scope.locals.clone())
@@ -46,7 +45,7 @@ fn frame_fcode(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
}
pub fn get_value(obj: &PyObjectRef) -> Frame {
if let PyObjectPayload::Frame { frame } = &obj.borrow().payload {
if let PyObjectPayload::Frame { frame } = &obj.payload {
frame.clone()
} else {
panic!("Inner error getting int {:?}", obj);