Skip to content

Commit

Permalink
Remove unneeded type conversions in spellchecker_hunspell.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
0tkl committed Dec 27, 2023
1 parent c88f918 commit 9beb709
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/spellchecker_hunspell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void HunspellSpellChecker::AddWord(std::string_view word) {
if (!hunspell) return;

// Add it to the in-memory dictionary
hunspell->add(conv->Convert(word).c_str());
hunspell->add(conv->Convert(word));

// Add the word
if (customWords.insert(std::string(word)).second)
Expand All @@ -70,7 +70,7 @@ void HunspellSpellChecker::RemoveWord(std::string_view word) {
if (!hunspell) return;

// Remove it from the in-memory dictionary
hunspell->remove(conv->Convert(word).c_str());
hunspell->remove(conv->Convert(word));

auto word_iter = customWords.find(word);
if (word_iter != customWords.end()) {
Expand Down Expand Up @@ -117,7 +117,7 @@ void HunspellSpellChecker::WriteUserDictionary() {
bool HunspellSpellChecker::CheckWord(std::string_view word) {
if (!hunspell) return true;
try {
return hunspell->spell(conv->Convert(word)) == 1;
return hunspell->spell(conv->Convert(word));
}
catch (agi::charset::ConvError const&) {
return false;
Expand Down Expand Up @@ -205,7 +205,7 @@ void HunspellSpellChecker::OnLanguageChanged() {

for (auto const& word : customWords) {
try {
hunspell->add(conv->Convert(word).c_str());
hunspell->add(conv->Convert(word));
}
catch (agi::charset::ConvError const&) {
// Normally this shouldn't happen, but some versions of Aegisub
Expand Down

0 comments on commit 9beb709

Please sign in to comment.