Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf6e99d1

Browse files
authored
Merge pull requestRustPython#574 from RustPython/fetch_ins
fetch_instruction can just return a reference.
2 parentsb0ee194 +786eb2c commitf6e99d1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

‎vm/src/frame.rs‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,8 @@ impl Frame {
141141
value
142142
}
143143

144-
pubfnfetch_instruction(&self) -> bytecode::Instruction{
145-
// TODO: an immutable reference is enough, we should not
146-
// clone the instruction.
147-
let ins2 =self.code.instructions[*self.lasti.borrow()].clone();
144+
pubfnfetch_instruction(&self) ->&bytecode::Instruction{
145+
let ins2 =&self.code.instructions[*self.lasti.borrow()];
148146
*self.lasti.borrow_mut() +=1;
149147
ins2
150148
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp