Remove some redundant .get()s

This commit is contained in:
Thomas Goyne 2014-11-04 08:27:36 -08:00
parent def24c25b3
commit 7300a1bf2d
6 changed files with 6 additions and 6 deletions

View file

@ -53,7 +53,7 @@ Thesaurus::~Thesaurus() { }
std::vector<Thesaurus::Entry> Thesaurus::Lookup(std::string const& word) {
std::vector<Entry> out;
if (!dat.get()) return out;
if (!dat) return out;
auto it = offsets.find(word);
if (it == offsets.end()) return out;

View file

@ -109,7 +109,7 @@ template<> agi::Color AssOverrideParameter::Get<agi::Color>() const {
}
template<> AssDialogueBlockOverride *AssOverrideParameter::Get<AssDialogueBlockOverride*>() const {
if (!block.get()) {
if (!block) {
block = agi::make_unique<AssDialogueBlockOverride>(Get<std::string>());
block->ParseTags();
}

View file

@ -139,7 +139,7 @@ DialogSpellChecker::DialogSpellChecker(agi::Context *context)
// List of supported spellchecker languages
{
if (!spellchecker.get()) {
if (!spellchecker) {
wxMessageBox("No spellchecker available.", "Error", wxOK | wxICON_ERROR | wxCENTER);
throw agi::UserCancelException("No spellchecker available");
}

View file

@ -46,7 +46,7 @@ Thesaurus::~Thesaurus() {
}
std::vector<Thesaurus::Entry> Thesaurus::Lookup(std::string word) {
if (!impl.get()) return {};
if (!impl) return {};
boost::to_lower(word);
return impl->Lookup(word);
}

View file

@ -61,7 +61,7 @@ void ToolTipManager::Bind(wxWindow *window, wxString tooltip, const char *contex
}
void ToolTipBinding::Update() {
if (!window.get()) return;
if (!window) return;
std::vector<std::string> hotkeys = hotkey::get_hotkey_strs(context, command);

View file

@ -368,7 +368,7 @@ void VideoDisplay::OnMouseWheel(wxMouseEvent& event) {
}
void VideoDisplay::OnContextMenu(wxContextMenuEvent&) {
if (!context_menu.get()) context_menu = menu::GetMenu("video_context", con);
if (!context_menu) context_menu = menu::GetMenu("video_context", con);
SetCursor(wxNullCursor);
menu::OpenPopupMenu(context_menu.get(), this);
}