From 8c11786145446c8cc1ecf86d0eb9428a2b43f0f6 Mon Sep 17 00:00:00 2001 From: James Puleo Date: Thu, 28 Jul 2022 03:49:00 -0400 Subject: [PATCH] HexEditor: Rename camel case variable names in `HexEditor::save_as` This also changes those variables to be references to the casted document type, instead of pointers. --- Userland/Applications/HexEditor/HexEditor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Userland/Applications/HexEditor/HexEditor.cpp b/Userland/Applications/HexEditor/HexEditor.cpp index addf4047fef..9093aa6013f 100644 --- a/Userland/Applications/HexEditor/HexEditor.cpp +++ b/Userland/Applications/HexEditor/HexEditor.cpp @@ -116,13 +116,13 @@ void HexEditor::set_selection(size_t position, size_t length) bool HexEditor::save_as(NonnullRefPtr new_file) { if (m_document->type() == HexDocument::Type::File) { - HexDocumentFile* fileDocument = static_cast(m_document.ptr()); - if (!fileDocument->write_to_file(new_file)) + auto& file_document = static_cast(*m_document); + if (!file_document.write_to_file(new_file)) return false; - fileDocument->set_file(new_file); + file_document.set_file(new_file); } else { - HexDocumentMemory* memoryDocument = static_cast(m_document.ptr()); - if (!memoryDocument->write_to_file(new_file)) + auto& memory_document = static_cast(*m_document); + if (!memory_document.write_to_file(new_file)) return false; m_document = make(new_file); }