From f4210c463cf7905c53f5bb73530b7762884be734 Mon Sep 17 00:00:00 2001 From: Saket Date: Fri, 22 Nov 2024 09:32:16 +0530 Subject: [PATCH] fix(repl-hist-persistence): avoids input copies --- compiler+runtime/src/cpp/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler+runtime/src/cpp/main.cpp b/compiler+runtime/src/cpp/main.cpp index a42ca0513..4789c0074 100644 --- a/compiler+runtime/src/cpp/main.cpp +++ b/compiler+runtime/src/cpp/main.cpp @@ -133,9 +133,9 @@ namespace jank /* TODO: Completion. */ /* TODO: Syntax highlighting. */ - while(std::optional const &buf = le.readLine()) + while(auto buf = le.readLine()) { - auto line(std::move(*buf)); + auto &line(*buf); boost::trim(line); if(line.ends_with("\\")) @@ -196,9 +196,9 @@ namespace jank le.setPrompt("native> "); native_transient_string input{}; - while(std::optional const &buf = le.readLine()) + while(auto buf = le.readLine()) { - auto line(std::move(*buf)); + auto &line(*buf); boost::trim(line); if(line.empty())