Skip to content

Commit a683930

Browse files
committed
feature(ThingData::set_variable): only add the string variable if it's not empty
1 parent 6397ddb commit a683930

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.30.0..4.3.0)
22
project(Nostalgia
3-
VERSION 0.13.0
3+
VERSION 0.13.1
44
LANGUAGES CXX C)
55

66
option(BUILD_SHARED_LIBS "Build the shared version of Nostalgia (Linux only)" OFF)

Nostalgia/Nostalgia.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#define NOSTALGIA_VERSION_MAJOR 0
88
#define NOSTALGIA_VERSION_MINOR 13
9-
#define NOSTALGIA_VERSION_PATCH 0
9+
#define NOSTALGIA_VERSION_PATCH 1
1010
#define NOSTALGIA_VERSION_STRING \
1111
__n_make_string(NOSTALGIA_VERSION_MAJOR) "." \
1212
__n_make_string(NOSTALGIA_VERSION_MINOR) "." \

Nostalgia/things/thing_data.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ std::string ThingData::get_parsable_string() const noexcept
7777
}
7878

7979
void ThingData::set_variable(Sarg inValue, Sarg inName)
80-
{ variables.emplace_back(inName, inValue, ThingVarType::String); }
80+
{
81+
if(not inValue.empty())
82+
{ variables.emplace_back(inName, inValue, ThingVarType::String); }
83+
}
8184

8285
void ThingData::clear()
8386
{

0 commit comments

Comments
 (0)