diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2016-01-16 01:30:22 +0100 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2016-01-16 01:30:22 +0100 |
commit | 63777f830d912bb129e32242a23b74d917b6f080 (patch) | |
tree | c40c81ba7309149989a10fe4836e309bf4cc9c60 /src/mod_http_upload_quota.erl | |
parent | Merge pull request #906 from hamano/stats_processes (diff) |
Use maps instead of dicts in HTTP upload modules
ejabberd currently depends on Erlang/OTP 17.1 or higher, so we can now
use maps.
Diffstat (limited to 'src/mod_http_upload_quota.erl')
-rw-r--r-- | src/mod_http_upload_quota.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mod_http_upload_quota.erl b/src/mod_http_upload_quota.erl index eea23d34..db0b4aa4 100644 --- a/src/mod_http_upload_quota.erl +++ b/src/mod_http_upload_quota.erl @@ -62,7 +62,7 @@ access_hard_quota :: atom(), max_days :: pos_integer() | infinity, docroot :: binary(), - disk_usage = dict:new() :: term(), + disk_usage = #{} :: map(), timers :: [timer:tref()]}). -type state() :: #state{}. @@ -172,7 +172,7 @@ handle_cast({handle_slot_request, #jid{user = U, server = S} = JID, Path, Size}, _ -> 0 end, - OldSize = case dict:find({U, S}, DiskUsage) of + OldSize = case maps:find({U, S}, DiskUsage) of {ok, Value} -> Value; error -> @@ -202,7 +202,7 @@ handle_cast({handle_slot_request, #jid{user = U, server = S} = JID, Path, Size}, enforce_quota(Path, Size, OldSize, SoftQuota, HardQuota) end, NewDiskUsage = if is_integer(NewSize) -> - dict:store({U, S}, NewSize, DiskUsage); + maps:put({U, S}, NewSize, DiskUsage); true -> DiskUsage end, |