mirror of
https://github.com/nushell/nushell.git
synced 2025-08-14 04:08:36 +02:00
Remove engine_state
clones in REPL eval (#7713)
A small but easy optimization for `evaluate_repl()`: clone `engine_state` 1x instead of 3x. This reduces time spent in a simple REPL eval (`enter` key pressed with no command text) by about 10%, as measured in [Superluminal](https://superluminal.eu/).
This commit is contained in:
@ -6,9 +6,10 @@ use nu_protocol::ast::{Argument, Block, Expr, Expression, PipelineElement};
|
||||
use nu_protocol::engine::{EngineState, StateWorkingSet};
|
||||
use nu_protocol::{Config, Span};
|
||||
use reedline::{Highlighter, StyledText};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct NuHighlighter {
|
||||
pub engine_state: EngineState,
|
||||
pub engine_state: Arc<EngineState>,
|
||||
pub config: Config,
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user