mirror of
https://github.com/nushell/nushell.git
synced 2025-01-05 13:59:46 +01:00
Don't read config in a tight loop (#614)
This commit is contained in:
parent
e94b8007c1
commit
c8330523c8
@ -384,7 +384,6 @@ pub fn eval_block(
|
|||||||
block: &Block,
|
block: &Block,
|
||||||
mut input: PipelineData,
|
mut input: PipelineData,
|
||||||
) -> Result<PipelineData, ShellError> {
|
) -> Result<PipelineData, ShellError> {
|
||||||
let config = stack.get_config().unwrap_or_default();
|
|
||||||
let num_stmts = block.stmts.len();
|
let num_stmts = block.stmts.len();
|
||||||
for (stmt_idx, stmt) in block.stmts.iter().enumerate() {
|
for (stmt_idx, stmt) in block.stmts.iter().enumerate() {
|
||||||
if let Statement::Pipeline(pipeline) = stmt {
|
if let Statement::Pipeline(pipeline) = stmt {
|
||||||
@ -420,6 +419,7 @@ pub fn eval_block(
|
|||||||
|
|
||||||
if stmt_idx < (num_stmts) - 1 {
|
if stmt_idx < (num_stmts) - 1 {
|
||||||
// Drain the input to the screen via tabular output
|
// Drain the input to the screen via tabular output
|
||||||
|
let config = stack.get_config().unwrap_or_default();
|
||||||
|
|
||||||
match engine_state.find_decl("table".as_bytes()) {
|
match engine_state.find_decl("table".as_bytes()) {
|
||||||
Some(decl_id) => {
|
Some(decl_id) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user