From 649fcd4067e7e6eb50828c9f709272c14ea5cd17 Mon Sep 17 00:00:00 2001 From: Garux Date: Fri, 2 Feb 2024 01:04:42 +0600 Subject: [PATCH] use CopiedString.empty() --- radiant/build.cpp | 2 +- radiant/environment.cpp | 2 +- radiant/referencecache.cpp | 2 +- radiant/textures.cpp | 2 +- radiant/xywindow.cpp | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/radiant/build.cpp b/radiant/build.cpp index 878dc77e..9555dd03 100644 --- a/radiant/build.cpp +++ b/radiant/build.cpp @@ -125,7 +125,7 @@ public: void evaluate( StringBuffer& output ) const override { StringBuffer buffer; m_test->evaluate( buffer ); - if ( !string_empty( buffer.c_str() ) ) { + if ( !buffer.empty() ) { m_result->evaluate( output ); } } diff --git a/radiant/environment.cpp b/radiant/environment.cpp index bd470af3..4701a35f 100644 --- a/radiant/environment.cpp +++ b/radiant/environment.cpp @@ -253,7 +253,7 @@ void environment_init( int argc, char* argv[] ){ { char real[PATH_MAX]; app_filepath = getexename( real ); - ASSERT_MESSAGE( !string_empty( app_filepath.c_str() ), "failed to deduce app path" ); + ASSERT_MESSAGE( !app_filepath.empty(), "failed to deduce app path" ); // NOTE: we build app path with a trailing '/' // it's a general convention in Radiant to have the slash at the end of directories app_path = PathFilenameless( real ); diff --git a/radiant/referencecache.cpp b/radiant/referencecache.cpp index 73328330..c332d2b0 100644 --- a/radiant/referencecache.cpp +++ b/radiant/referencecache.cpp @@ -492,7 +492,7 @@ struct ModelResource : public Resource return true; } bool isModified() const { - return ( ( !string_empty( m_path.c_str() ) // had or has an absolute path + return ( ( !m_path.empty() // had or has an absolute path && m_modified != modified() ) // AND disk timestamp changed || !path_equal( rootPath( m_originalName.c_str() ), m_path.c_str() ) ); // OR absolute vfs-root changed } diff --git a/radiant/textures.cpp b/radiant/textures.cpp index e6593dc9..af37780c 100644 --- a/radiant/textures.cpp +++ b/radiant/textures.cpp @@ -333,7 +333,7 @@ typedef std::pair TextureKey; void qtexture_realise( qtexture_t& texture, const TextureKey& key ){ texture.texture_number = 0; - if ( !string_empty( key.second.c_str() ) ) { + if ( !key.second.empty() ) { if( !key.first.m_skybox ){ Image* image = key.first.loadImage( key.second.c_str() ); if ( image != 0 ) { diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index a2b35e0c..6a10b5ed 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -827,13 +827,13 @@ public: m_stack.push_back( MenuPair( menu, "" ) ); } ~EntityClassMenuInserter(){ - if ( !string_empty( m_previous.c_str() ) ) { + if ( !m_previous.empty() ) { addItem( m_previous.c_str(), "" ); } } void visit( EntityClass* e ){ ASSERT_MESSAGE( !string_empty( e->name() ), "entity-class has no name" ); - if ( !string_empty( m_previous.c_str() ) ) { + if ( !m_previous.empty() ) { addItem( m_previous.c_str(), e->name() ); } m_previous = e->name();