*: use transparent comparison for std::{map,set} with std::string keys

This avoids many std::string temporaries for lookups.
This commit is contained in:
Max Kellermann
2023-03-12 09:11:45 +01:00
parent 27d3dcf14c
commit 8b77da545d
23 changed files with 34 additions and 34 deletions
+1 -1
View File
@@ -129,7 +129,7 @@ StickerDatabase::LoadValue(const char *type, const char *uri, const char *name)
}
void
StickerDatabase::ListValues(std::map<std::string, std::string> &table,
StickerDatabase::ListValues(std::map<std::string, std::string, std::less<>> &table,
const char *type, const char *uri)
{
sqlite3_stmt *const s = stmt[STICKER_SQL_LIST];
+1 -1
View File
@@ -127,7 +127,7 @@ public:
void *user_data);
private:
void ListValues(std::map<std::string, std::string> &table,
void ListValues(std::map<std::string, std::string, std::less<>> &table,
const char *type, const char *uri);
bool UpdateValue(const char *type, const char *uri,
+1 -1
View File
@@ -8,7 +8,7 @@
#include <string>
struct Sticker {
std::map<std::string, std::string> table;
std::map<std::string, std::string, std::less<>> table;
};
#endif