diff options
author | Kim Alvefur <zash@zash.se> | 2023-11-27 00:14:56 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-11-27 00:14:56 +0100 |
commit | b97c4ffc16fe14fcf40d4808835b3fa3c46e9b1c (patch) | |
tree | 61bbb7f75f3cfb3eeb23931f1462e7e83e351b9c /util | |
parent | f5f64e3bdc3c355b9e3e0a37e092169bc1842ff3 (diff) | |
download | prosody-b97c4ffc16fe14fcf40d4808835b3fa3c46e9b1c.tar.gz prosody-b97c4ffc16fe14fcf40d4808835b3fa3c46e9b1c.zip |
util.datamanager: Load first item into index earlier
Should get rid of fseek() call
Diffstat (limited to 'util')
-rw-r--r-- | util/datamanager.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua index 6d61aea5..ca77cda8 100644 --- a/util/datamanager.lua +++ b/util/datamanager.lua @@ -424,7 +424,8 @@ local function get_list_index(username, host, datastore) end if ih then - return setmetatable({ file = ih }, index_mt); + local first_length = string.unpack(ih:read(index_item_size)); + return setmetatable({ file = ih; { start = 0; length = first_length } }, index_mt); end local index, err = build_list_index(username, host, datastore); |