From 6ed576974dec969ad2745a451a6f680a3cdbcfc4 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Thu, 22 Feb 2024 18:53:21 +0100 Subject: feat: Sync --- lib/data.c | 4 ++-- lib/list.c | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/data.c b/lib/data.c index 1c1a754..afbbbb1 100644 --- a/lib/data.c +++ b/lib/data.c @@ -6,8 +6,8 @@ #include "../lib/util.h" const char *insert_into = "INSERT INTO words (LINE) VALUES($VVV);"; -const char *select_words = "SELECT Id, Line FROM words WHERE line like $VVV LIMIT $NNN;"; -const char *create_table = "CREATE TABLE IF NOT EXISTS words (ID INTEGER PRIMARY KEY AUTOINCREMENT, LINE TEXT NOT NULL);"; +const char *select_words = "SELECT Id, Line FROM words WHERE line MATCH $VVV LIMIT $NNN;"; +const char *create_table = "CREATE VIRTUAL TABLE IF NOT EXISTS words USING fts4 (ID INTEGER PRIMARY KEY AUTOINCREMENT, LINE TEXT NOT NULL);"; Data* new_data(const char* con) { diff --git a/lib/list.c b/lib/list.c index 52feb76..be1ac61 100644 --- a/lib/list.c +++ b/lib/list.c @@ -36,9 +36,6 @@ LIST* list_remove(LIST* list, unsigned int pos) void list_free(LIST* list) { - for (unsigned int x = 0; x < list->size; x++) - free(list->list[x]); - free(list->list); free(list); } -- cgit v1.2.3