summaryrefslogtreecommitdiffstats
path: root/src/URI.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-12-08 19:43:02 +0100
committerDavid Robillard <d@drobilla.net>2019-12-08 21:08:26 +0100
commit097dd7167279729a7df9f0cef67c549e70e74d4e (patch)
tree3d7746c36c9c9d7aa389329710787f9a8af746b1 /src/URI.cpp
parent9a2c78b83adfcd654539a89f9a7b00ce47ccdd71 (diff)
downloadingen-097dd7167279729a7df9f0cef67c549e70e74d4e.tar.gz
ingen-097dd7167279729a7df9f0cef67c549e70e74d4e.tar.bz2
ingen-097dd7167279729a7df9f0cef67c549e70e74d4e.zip
Cleanup: Improve a few basic operator implementations
Diffstat (limited to 'src/URI.cpp')
-rw-r--r--src/URI.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/URI.cpp b/src/URI.cpp
index 67a26ee9..f7b64209 100644
--- a/src/URI.cpp
+++ b/src/URI.cpp
@@ -81,8 +81,11 @@ URI::URI(const URI& uri)
URI&
URI::operator=(const URI& uri)
{
- serd_node_free(&_node);
- _node = serd_node_new_uri(&uri._uri, nullptr, &_uri);
+ if (&uri != this) {
+ serd_node_free(&_node);
+ _node = serd_node_new_uri(&uri._uri, nullptr, &_uri);
+ }
+
return *this;
}