Skip to content

Commit

Permalink
remove no longer used QLC functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Th3-M4jor committed Aug 11, 2024
1 parent f9ab495 commit af23bc5
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 44 deletions.
7 changes: 1 addition & 6 deletions src/nostrum_guild_cache_qlc.erl
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
-module(nostrum_guild_cache_qlc).
-export([all/1, get/2]).
-export([all/1]).

-include_lib("stdlib/include/qlc.hrl").

% Optimized channel cache QLC queries.

all(Cache) ->
qlc:q([Guild || {_GuildId, Guild} <- Cache:query_handle()]).


get(RequestedGuildId, Cache) ->
qlc:q([Guild || {GuildId, Guild} <- Cache:query_handle(),
GuildId =:= RequestedGuildId]).
13 changes: 1 addition & 12 deletions src/nostrum_member_cache_qlc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
% I assume this is caused by the Erlang parse transform doing smart things at compile time.

-module(nostrum_member_cache_qlc).
-export([by_user/2, by_guild/2, lookup/3, get_with_users/3]).
-export([by_user/2, by_guild/2, get_with_users/3]).

-include_lib("stdlib/include/qlc.hrl").

Expand Down Expand Up @@ -46,17 +46,6 @@ by_guild(RequestedGuildId, Cache) ->
qlc:q([Member || {{GuildId, _MemberId}, Member} <- Cache:query_handle(),
GuildId =:= RequestedGuildId]).

-spec lookup('Elixir.Nostrum.Struct.Guild':id(), 'Elixir.Nostrum.Struct.User':id(), module()) -> qlc:query_handle().
lookup(RequestedGuildId, RequestedUserId, ?MNESIA_CACHE) ->
qlc:q([Member || ?MNESIA_FORMAT <- ?MNESIA_CACHE:query_handle(),
GuildId =:= RequestedGuildId,
MemberId =:= RequestedUserId]);

lookup(RequestedGuildId, RequestedUserId, Cache) ->
qlc:q([Member || {{GuildId, MemberId}, Member} <- Cache:query_handle(),
GuildId =:= RequestedGuildId,
MemberId =:= RequestedUserId]).


-spec get_with_users('Elixir.Nostrum.Struct.Guild':id(), module(), module()) -> qlc:query_handle().
get_with_users(RequestedGuildId, ?MNESIA_CACHE, UserCache) ->
Expand Down
11 changes: 0 additions & 11 deletions src/nostrum_presence_cache_qlc.erl

This file was deleted.

15 changes: 0 additions & 15 deletions src/nostrum_user_cache_qlc.erl

This file was deleted.

0 comments on commit af23bc5

Please sign in to comment.