From 81af6d65cdafe9a6a7de209a611754055e48d85d Mon Sep 17 00:00:00 2001 From: teknomunk Date: Sat, 19 Aug 2023 17:37:30 -0500 Subject: [PATCH] Remove data/account/uri_index and use trie exclusively --- src/model/account.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/model/account.c b/src/model/account.c index dfc3d9c..0fbeaae 100644 --- a/src/model/account.c +++ b/src/model/account.c @@ -236,8 +236,6 @@ static bool index_uri_to_account_id( const char* uri, int account_id ) } ffdb_trie_set( "data/accounts/by-uri", uri, id_str ); - hash_index_remove( "data/accounts/uri_index/", uri ); - //return hash_index_set( "data/accounts/uri_index/", uri, account_id ); return true; } @@ -282,21 +280,7 @@ int account_id_from_uri( const char* uri ) return id; } - int result = 0; - if( !hash_index_get( "data/accounts/uri_index/", uri, &result ) ) { - //return account_search_for_id_from_uri( uri ); - return -1; - } - - // Migrate to trie - { - char id_str[32]; - snprintf( id_str,32, "%d", result ); - ffdb_trie_set( "data/accounts/by-uri", uri, id_str ); - hash_index_remove( "data/accounts/uri_index/", uri ); - } - - return result; + return -1; } static int lookup_account_id_from_uri( const char* uri ) { @@ -520,11 +504,9 @@ void account_save( struct account* a ) char id_str[32]; snprintf( id_str,32, "%d", a->id ); ffdb_trie_set( "data/accounts/by-uri", a->account_url, id_str ); - hash_index_remove( "data/accounts/uri_index/", a->account_url ); if( a->account_id ) { ffdb_trie_set( "data/accounts/by-uri", a->account_id, id_str ); - hash_index_remove( "data/accounts/uri_index/", a->account_id ); } }