1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 08:35:20 +02:00

Replace Optional with std::optional

This commit is contained in:
Desour
2023-06-11 22:55:36 +02:00
committed by sfan5
parent 34ad551efc
commit e700182f44
15 changed files with 39 additions and 198 deletions

View File

@@ -509,7 +509,7 @@ void ChatPrompt::addToHistory(const std::wstring &line)
auto entry = m_history.begin() + m_history_index;
if (entry->saved && entry->line == line) {
entry->line = *entry->saved;
entry->saved = nullopt;
entry->saved = std::nullopt;
// Remove potential duplicates
auto dup_before = std::find(m_history.begin(), entry, *entry);
if (dup_before != entry)