summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-04 17:21:44 +0000
committerDavid Robillard <d@drobilla.net>2010-02-04 17:21:44 +0000
commit7c19aa2a97c1e19b27b66c58a84c46489101950e (patch)
tree72b2fac98b6f69bc16770194900c0e0bec86311b /src/engine
parentb8ef9bff8a46a682f68585aad7587bf081e8b7f8 (diff)
downloadingen-7c19aa2a97c1e19b27b66c58a84c46489101950e.tar.gz
ingen-7c19aa2a97c1e19b27b66c58a84c46489101950e.tar.bz2
ingen-7c19aa2a97c1e19b27b66c58a84c46489101950e.zip
Use std::string::empty where possible (faster, and less prone to C string errors).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2420 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/HTTPEngineReceiver.cpp2
-rw-r--r--src/engine/JackDriver.cpp6
-rw-r--r--src/engine/LV2Plugin.cpp2
-rw-r--r--src/engine/NodeBase.hpp2
-rw-r--r--src/engine/NodeFactory.cpp6
-rw-r--r--src/engine/events/CreateNode.cpp2
-rw-r--r--src/engine/events/CreatePort.cpp1
7 files changed, 10 insertions, 11 deletions
diff --git a/src/engine/HTTPEngineReceiver.cpp b/src/engine/HTTPEngineReceiver.cpp
index 025243eb..dbda1ddd 100644
--- a/src/engine/HTTPEngineReceiver.cpp
+++ b/src/engine/HTTPEngineReceiver.cpp
@@ -117,7 +117,7 @@ HTTPEngineReceiver::message_callback(SoupServer* server, SoupMessage* msg, const
// Special GET paths
if (msg->method == SOUP_METHOD_GET) {
- if (path == Path::root.str() || path == "") {
+ if (path == Path::root.str() || path.empty()) {
const string r = string("@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n")
.append("\n<> rdfs:seeAlso <plugins> ;")
.append("\n rdfs:seeAlso <stream> ;")
diff --git a/src/engine/JackDriver.cpp b/src/engine/JackDriver.cpp
index fc2e5e59..e903586e 100644
--- a/src/engine/JackDriver.cpp
+++ b/src/engine/JackDriver.cpp
@@ -219,13 +219,13 @@ JackDriver::supports(Shared::PortType port_type, Shared::EventType event_type)
bool
JackDriver::attach(const std::string& server_name,
- const std::string& client_name,
- void* jack_client)
+ const std::string& client_name,
+ void* jack_client)
{
assert(!_client);
if (!jack_client) {
// Try supplied server name
- if (server_name != "") {
+ if (!server_name.empty()) {
_client = jack_client_open(client_name.c_str(),
JackServerName, NULL, server_name.c_str());
if (_client)
diff --git a/src/engine/LV2Plugin.cpp b/src/engine/LV2Plugin.cpp
index 95cb93f0..d522307a 100644
--- a/src/engine/LV2Plugin.cpp
+++ b/src/engine/LV2Plugin.cpp
@@ -97,7 +97,7 @@ const std::string&
LV2Plugin::library_path() const
{
static const std::string empty_string;
- if (_library_path == "") {
+ if (_library_path.empty()) {
SLV2Value v = slv2_plugin_get_library_uri(_slv2_plugin);
if (v) {
_library_path = slv2_uri_to_path(slv2_value_as_uri(v));
diff --git a/src/engine/NodeBase.hpp b/src/engine/NodeBase.hpp
index 950a79a3..637c8560 100644
--- a/src/engine/NodeBase.hpp
+++ b/src/engine/NodeBase.hpp
@@ -41,8 +41,6 @@ namespace Shared { class ClientInterface; }
/** Common implementation stuff for Node.
*
- * Pretty much just attributes and getters/setters are here.
- *
* \ingroup engine
*/
class NodeBase : public NodeImpl
diff --git a/src/engine/NodeFactory.cpp b/src/engine/NodeFactory.cpp
index de321077..335feb26 100644
--- a/src/engine/NodeFactory.cpp
+++ b/src/engine/NodeFactory.cpp
@@ -86,7 +86,7 @@ NodeFactory::plugin(const Raul::URI& uri)
PluginImpl*
NodeFactory::plugin(const string& type, const string& lib, const string& label)
{
- if (type != "LADSPA" || lib == "" || label == "")
+ if (type != "LADSPA" || lib.empty() || label.empty())
return NULL;
#ifdef HAVE_LADSPA_H
@@ -206,12 +206,12 @@ NodeFactory::load_ladspa_plugins()
}
// Yep, this should use an sstream alright..
- while (ladspa_path != "") {
+ while (!ladspa_path.empty()) {
const string dir = ladspa_path.substr(0, ladspa_path.find(':'));
if (ladspa_path.find(':') != string::npos)
ladspa_path = ladspa_path.substr(ladspa_path.find(':')+1);
else
- ladspa_path = "";
+ ladspa_path.clear();
DIR* pdir = opendir(dir.c_str());
if (pdir == NULL)
diff --git a/src/engine/events/CreateNode.cpp b/src/engine/events/CreateNode.cpp
index 426044ee..4f5b4877 100644
--- a/src/engine/events/CreateNode.cpp
+++ b/src/engine/events/CreateNode.cpp
@@ -83,7 +83,7 @@ CreateNode::pre_process()
_patch = _engine.engine_store()->find_patch(_path.parent());
- _plugin = (_plugin_label == "")
+ _plugin = (_plugin_label.empty())
? _engine.node_factory()->plugin(_plugin_uri.str())
: _engine.node_factory()->plugin(_plugin_type, _plugin_lib, _plugin_label);
diff --git a/src/engine/events/CreatePort.cpp b/src/engine/events/CreatePort.cpp
index b12f25dc..f1656019 100644
--- a/src/engine/events/CreatePort.cpp
+++ b/src/engine/events/CreatePort.cpp
@@ -98,6 +98,7 @@ CreatePort::pre_process()
if (_patch->parent())
_patch_port->set_property(uris.rdf_instanceOf, _patch_port->meta_uri());
+ _patch_port->properties().insert(_properties.begin(), _properties.end());
_patch_port->meta().properties().insert(_properties.begin(), _properties.end());
if (_patch_port) {