2020#endif
2121
2222using namespace llvm ;
23- constexpr int DefaultHistorySize = 800 ;
2423
2524std::string LineEditor::getDefaultHistoryPath (StringRef ProgName) {
2625 SmallString<32 > Path;
@@ -221,8 +220,8 @@ LineEditor::LineEditor(StringRef ProgName, StringRef HistoryPath, FILE *In,
221220 NULL ); // Fix the delete key.
222221 ::el_set (Data->EL, EL_CLIENTDATA, Data.get());
223222
224- setHistorySize (DefaultHistorySize);
225223 HistEvent HE;
224+ ::history (Data->Hist, &HE, H_SETSIZE, 800 );
226225 ::history (Data->Hist, &HE, H_SETUNIQUE, 1 );
227226 loadHistory ();
228227}
@@ -249,11 +248,6 @@ void LineEditor::loadHistory() {
249248 }
250249}
251250
252- void LineEditor::setHistorySize (int size) {
253- HistEvent HE;
254- ::history (Data->Hist, &HE, H_SETSIZE, size);
255- }
256-
257251std::optional<std::string> LineEditor::readLine () const {
258252 // Call el_gets to prompt the user and read the user's input.
259253 int LineLen = 0 ;
@@ -297,7 +291,6 @@ LineEditor::~LineEditor() {
297291
298292void LineEditor::saveHistory () {}
299293void LineEditor::loadHistory () {}
300- void LineEditor::setHistorySize (int size) {}
301294
302295std::optional<std::string> LineEditor::readLine () const {
303296 ::fprintf (Data->Out, " %s" , Prompt.c_str());
0 commit comments