[epiphany/gnome-3-22] history-service: Remove useless allocations
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gnome-3-22] history-service: Remove useless allocations
- Date: Fri, 24 Feb 2017 14:02:05 +0000 (UTC)
commit 0a6e90f8badde14b3bd6e112a9df2c8b68ef41bf
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Tue Feb 21 09:54:11 2017 -0600
history-service: Remove useless allocations
lib/history/ephy-history-service-hosts-table.c | 7 +++----
lib/history/ephy-history-service-urls-table.c | 7 +++----
2 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/lib/history/ephy-history-service-hosts-table.c b/lib/history/ephy-history-service-hosts-table.c
index bb0d18b..a4f1abb 100644
--- a/lib/history/ephy-history-service-hosts-table.c
+++ b/lib/history/ephy-history-service-hosts-table.c
@@ -424,7 +424,7 @@ ephy_history_service_delete_host_row (EphyHistoryService *self,
EphyHistoryHost *host)
{
EphySQLiteStatement *statement = NULL;
- gchar *sql_statement;
+ const char *sql_statement;
GError *error = NULL;
g_assert (self->history_thread == g_thread_self ());
@@ -433,13 +433,12 @@ ephy_history_service_delete_host_row (EphyHistoryService *self,
g_assert (host->id != -1 || host->url);
if (host->id != -1)
- sql_statement = g_strdup ("DELETE FROM hosts WHERE id=?");
+ sql_statement = "DELETE FROM hosts WHERE id=?";
else
- sql_statement = g_strdup ("DELETE FROM hosts WHERE url=?");
+ sql_statement = "DELETE FROM hosts WHERE url=?";
statement = ephy_sqlite_connection_create_statement (self->history_database,
sql_statement, &error);
- g_free (sql_statement);
if (error) {
g_warning ("Could not build urls table query statement: %s", error->message);
diff --git a/lib/history/ephy-history-service-urls-table.c b/lib/history/ephy-history-service-urls-table.c
index 56675bd..602d073 100644
--- a/lib/history/ephy-history-service-urls-table.c
+++ b/lib/history/ephy-history-service-urls-table.c
@@ -388,7 +388,7 @@ void
ephy_history_service_delete_url (EphyHistoryService *self, EphyHistoryURL *url)
{
EphySQLiteStatement *statement = NULL;
- gchar *sql_statement;
+ const char *sql_statement;
GError *error = NULL;
g_assert (self->history_thread == g_thread_self ());
@@ -397,13 +397,12 @@ ephy_history_service_delete_url (EphyHistoryService *self, EphyHistoryURL *url)
g_return_if_fail (url->id != -1 || url->url);
if (url->id != -1)
- sql_statement = g_strdup ("DELETE FROM urls WHERE id=?");
+ sql_statement = "DELETE FROM urls WHERE id=?";
else
- sql_statement = g_strdup ("DELETE FROM urls WHERE url=?");
+ sql_statement = "DELETE FROM urls WHERE url=?";
statement = ephy_sqlite_connection_create_statement (self->history_database,
sql_statement, &error);
- g_free (sql_statement);
if (error) {
g_warning ("Could not build urls table query statement: %s", error->message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]