Commit 7dbe5f46 authored by Max Kellermann's avatar Max Kellermann

sticker/Database: remove redundant sqlite3_reset() calls

Call sqlite3_reset() only after a sqlite3_stmt* has been used, not before. Assume it is already in reusable state.
parent 432ecd1b
...@@ -212,8 +212,6 @@ sticker_load_value(const char *type, const char *uri, const char *name) ...@@ -212,8 +212,6 @@ sticker_load_value(const char *type, const char *uri, const char *name)
if (*name == 0) if (*name == 0)
return std::string(); return std::string();
sqlite3_reset(stmt);
if (!BindAll(stmt, type, uri, name)) if (!BindAll(stmt, type, uri, name))
return std::string(); return std::string();
...@@ -249,8 +247,6 @@ sticker_list_values(std::map<std::string, std::string> &table, ...@@ -249,8 +247,6 @@ sticker_list_values(std::map<std::string, std::string> &table,
assert(uri != nullptr); assert(uri != nullptr);
assert(sticker_enabled()); assert(sticker_enabled());
sqlite3_reset(stmt);
if (!BindAll(stmt, type, uri)) if (!BindAll(stmt, type, uri))
return false; return false;
...@@ -297,8 +293,6 @@ sticker_update_value(const char *type, const char *uri, ...@@ -297,8 +293,6 @@ sticker_update_value(const char *type, const char *uri,
assert(sticker_enabled()); assert(sticker_enabled());
sqlite3_reset(stmt);
if (!BindAll(stmt, value, type, uri, name)) if (!BindAll(stmt, value, type, uri, name))
return false; return false;
...@@ -335,8 +329,6 @@ sticker_insert_value(const char *type, const char *uri, ...@@ -335,8 +329,6 @@ sticker_insert_value(const char *type, const char *uri,
assert(sticker_enabled()); assert(sticker_enabled());
sqlite3_reset(stmt);
if (!BindAll(stmt, type, uri, name, value)) if (!BindAll(stmt, type, uri, name, value))
return false; return false;
...@@ -384,8 +376,6 @@ sticker_delete(const char *type, const char *uri) ...@@ -384,8 +376,6 @@ sticker_delete(const char *type, const char *uri)
assert(type != nullptr); assert(type != nullptr);
assert(uri != nullptr); assert(uri != nullptr);
sqlite3_reset(stmt);
if (!BindAll(stmt, type, uri)) if (!BindAll(stmt, type, uri))
return false; return false;
...@@ -415,8 +405,6 @@ sticker_delete_value(const char *type, const char *uri, const char *name) ...@@ -415,8 +405,6 @@ sticker_delete_value(const char *type, const char *uri, const char *name)
assert(type != nullptr); assert(type != nullptr);
assert(uri != nullptr); assert(uri != nullptr);
sqlite3_reset(stmt);
if (!BindAll(stmt, type, uri, name)) if (!BindAll(stmt, type, uri, name))
return false; return false;
...@@ -493,8 +481,6 @@ sticker_find(const char *type, const char *base_uri, const char *name, ...@@ -493,8 +481,6 @@ sticker_find(const char *type, const char *base_uri, const char *name,
assert(func != nullptr); assert(func != nullptr);
assert(sticker_enabled()); assert(sticker_enabled());
sqlite3_reset(stmt);
if (base_uri == nullptr) if (base_uri == nullptr)
base_uri = ""; base_uri = "";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment