From ed364bb71e7dcc22292b175c03f56e99eaea8bc9 Mon Sep 17 00:00:00 2001 From: Sverre Rabbelier Date: Sat, 12 Apr 2008 13:13:29 +0200 Subject: [PATCH] Use Assert in UBSocket instead of Global::bugf. --- src/Core/Socket/UBSocket.cpp | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/src/Core/Socket/UBSocket.cpp b/src/Core/Socket/UBSocket.cpp index 0622a97..3473c08 100644 --- a/src/Core/Socket/UBSocket.cpp +++ b/src/Core/Socket/UBSocket.cpp @@ -172,25 +172,11 @@ void UBSocket::SwitchEditors() if(!m_popeditor && !m_nexteditor) return; - if(m_popeditor && m_nexteditor) - { - Global::Get()->bug("UBSocket::SwitchEditors() was called, but we don't have both a new editor and we want to pop one?!"); - Send("Something went wrong, somehow you are switching to another editor but you're also deleting the top one?!\n"); - Send("Closing your connection now.\n"); - SetCloseAndDelete(); - return; - } + Assert(!(m_popeditor && m_nexteditor)); if(m_popeditor || m_popLast) { - if(m_editors.empty()) // should never happen - { - Global::Get()->bug("UBSocket::SwitchEditors() was called, but we don't have a current editor?!"); - Send("Something went wrong, somehow you are switching to another editor but you don't have one set?!\n"); - Send("Closing your connection now.\n"); - SetCloseAndDelete(); - return; - } + Assert(!(m_editors.empty())) delete m_editors.front(); m_editors.pop_front(); @@ -216,15 +202,8 @@ void UBSocket::SwitchEditors() void UBSocket::PopEditor() { - if(m_popeditor) - { - Global::Get()->bug("UBSocket::PopEditor() was called, but the top editor is already being popped?!"); - Send("Something went wrong, somehow you are popping the top editor but it was already being popped?!\n"); - Send("Closing your connection now.\n"); - SetCloseAndDelete(); - return; - } - + Assert(!m_popeditor); + m_popeditor = true; SetPrompt(); } -- 2.11.4.GIT