Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Diff of /libkwave/LRU_Cache.h [02018c] .. [b9c28e] Maximize Restore

  Switch to side-by-side view

--- a/libkwave/LRU_Cache.h
+++ b/libkwave/LRU_Cache.h
@@ -71,10 +71,14 @@
 		while (it.hasNext()) {
 		    Pair &p = it.next();
 		    if (p.first == index) {
-			// found it -> move the entry to the start of the list
-			Pair pair = p;
-			it.remove();
-			insert(pair.first, pair.second);
+			if (p.first != QLinkedList<Pair>::first().first) {
+			    // found it -> move the entry to the start of the list
+			    Pair pair = p;
+			    it.remove();
+			    insert(pair.first, pair.second);
+// 			    qDebug("Kwave::MemoryManager[%9d] - reordering",
+// 			           pair.first);
+			}
 
 			// get the newly entered entry again
 			return QLinkedList<Pair>::first().second;