mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
Invert the inverted boolean
This commit is contained in:
3 files changed
+11
-5
No files matched your search
@@ -53,7 +53,13 @@ bitflags! {
|
||||
const HAS_DEFAULTS = 0x01;
|
||||
const HAS_KW_ONLY_DEFAULTS = 0x02;
|
||||
const HAS_ANNOTATIONS = 0x04;
|
||||
const NO_NEW_LOCALS = 0x08;
|
||||
const NEW_LOCALS = 0x08;
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for FunctionOpArg {
|
||||
fn default() -> Self {
|
||||
Self::NEW_LOCALS
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -672,7 +672,7 @@ impl<O: OutputStream> Compiler<O> {
|
||||
));
|
||||
self.enter_scope();
|
||||
|
||||
let mut flags = bytecode::FunctionOpArg::empty();
|
||||
let mut flags = bytecode::FunctionOpArg::default();
|
||||
if have_defaults {
|
||||
flags |= bytecode::FunctionOpArg::HAS_DEFAULTS;
|
||||
}
|
||||
@@ -992,7 +992,7 @@ impl<O: OutputStream> Compiler<O> {
|
||||
|
||||
// Turn code object into function object:
|
||||
self.emit(Instruction::MakeFunction {
|
||||
flags: bytecode::FunctionOpArg::NO_NEW_LOCALS,
|
||||
flags: bytecode::FunctionOpArg::default() & !bytecode::FunctionOpArg::NEW_LOCALS,
|
||||
});
|
||||
|
||||
self.emit(Instruction::LoadConst {
|
||||
@@ -1929,7 +1929,7 @@ impl<O: OutputStream> Compiler<O> {
|
||||
|
||||
// Turn code object into function object:
|
||||
self.emit(Instruction::MakeFunction {
|
||||
flags: bytecode::FunctionOpArg::empty(),
|
||||
flags: bytecode::FunctionOpArg::default(),
|
||||
});
|
||||
|
||||
// Evaluate iterated item:
|
||||
|
||||
+1
-1
@@ -1058,7 +1058,7 @@ impl Frame {
|
||||
scope,
|
||||
defaults,
|
||||
kw_only_defaults,
|
||||
!flags.contains(bytecode::FunctionOpArg::NO_NEW_LOCALS),
|
||||
flags.contains(bytecode::FunctionOpArg::NEW_LOCALS),
|
||||
);
|
||||
|
||||
let name = qualified_name.as_str().split('.').next_back().unwrap();
|
||||
|
||||
Reference in new issue
Block a user