about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libstore/db.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstore/db.cc b/src/libstore/db.cc
index 7ded82ef1fe8..86509697a3c4 100644
--- a/src/libstore/db.cc
+++ b/src/libstore/db.cc
@@ -451,7 +451,7 @@ void Database::enumTable(const Transaction & txn, TableId table,
             checkInterrupt();
             string data((char *) kt.get_data(), kt.get_size());
             if (!keyPrefix.empty() &&
-                data.compare(0, keyPrefix.size(), keyPrefix) != 0)
+                string(data, 0, keyPrefix.size()) != keyPrefix)
                 break;
             keys.push_back(data);
             flags = DB_NEXT;