vrepl: minor optimization (#5633)

pull/5638/head
yuyi 2020-07-03 17:22:34 +08:00 committed by GitHub
parent 3c432f5e07
commit 31104d73b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -242,9 +242,7 @@ fn run_repl(workdir string, vrepl_prefix string) {
r.temp_lines.delete(0)
}
if r.line.starts_with('import ') || r.line.starts_with('#include ') {
mut imports := r.imports
r.imports = [r.line]
r.imports << imports
r.imports << r.line
} else {
r.lines << r.line
}