diff options
author | David Robillard <d@drobilla.net> | 2010-02-02 20:37:50 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-02-02 20:37:50 +0000 |
commit | 36573e798c986e298c62daabed6036b12ea0314d (patch) | |
tree | c908c681c6f584831366283bf7c099b36f94ff52 /raul/TableImpl.hpp | |
parent | 53648252376649bca9868aec48ad4a290e3ae073 (diff) | |
download | raul-36573e798c986e298c62daabed6036b12ea0314d.tar.gz raul-36573e798c986e298c62daabed6036b12ea0314d.tar.bz2 raul-36573e798c986e298c62daabed6036b12ea0314d.zip |
Use Glib string interning (quarks) to make Path/URI operator== very fast.
This avoids a ton of string comparison overhead in Ingen when setting various
properties (e.g. "ingen:value" was compared several times every time a port
value was changed, now this is just a single pointer comparison and the full
round trip of a value change does no string comparison at all, but is still
property based and RDFey).
git-svn-id: http://svn.drobilla.net/lad/trunk/raul@2408 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'raul/TableImpl.hpp')
-rw-r--r-- | raul/TableImpl.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/raul/TableImpl.hpp b/raul/TableImpl.hpp index 0b32a29..6b91d01 100644 --- a/raul/TableImpl.hpp +++ b/raul/TableImpl.hpp @@ -264,7 +264,7 @@ Table<K,T>::insert(const std::pair<K, T>& entry) const K& key = entry.first; const T& value = entry.second; - if (size() == 0 || (size() == 1 && key > _entries[0].first)) { + if (size() == 0 || (size() == 1 && _entries[0].first < key)) { _entries.push_back(entry); return std::make_pair(iterator(*this, size()-1), true); } else if (size() == 1) { @@ -291,7 +291,7 @@ Table<K,T>::insert(const std::pair<K, T>& entry) if (elem.first == key) { elem.second = value; return std::make_pair(iterator(*this, i), false); - } else if (elem.first > key) { + } else if (key < elem.first) { if (i == 0 || _entries[i-1].first < key) break; upper = i - 1; |