Skip to content

Commit

Permalink
fix(repl-hist-persistence): avoids input copies
Browse files Browse the repository at this point in the history
  • Loading branch information
Samy-33 committed Nov 22, 2024
1 parent aa3f953 commit f4210c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler+runtime/src/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ namespace jank

/* TODO: Completion. */
/* TODO: Syntax highlighting. */
while(std::optional<native_transient_string> const &buf = le.readLine())
while(auto buf = le.readLine())
{
auto line(std::move(*buf));
auto &line(*buf);
boost::trim(line);

if(line.ends_with("\\"))
Expand Down Expand Up @@ -196,9 +196,9 @@ namespace jank
le.setPrompt("native> ");
native_transient_string input{};

while(std::optional<native_transient_string> const &buf = le.readLine())
while(auto buf = le.readLine())
{
auto line(std::move(*buf));
auto &line(*buf);
boost::trim(line);

if(line.empty())
Expand Down

0 comments on commit f4210c4

Please sign in to comment.