Mercurial > prosody-hg
diff util/datamanager.lua @ 13358:2b8ec22988af
util.datamanager: Load first item into index earlier
Should get rid of fseek() call
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 27 Nov 2023 00:14:56 +0100 |
| parents | 20b7de7ab66a |
| children | 971fd4cb09d4 |
line wrap: on
line diff
--- a/util/datamanager.lua Sun Nov 26 22:58:11 2023 +0100 +++ b/util/datamanager.lua Mon Nov 27 00:14:56 2023 +0100 @@ -424,7 +424,8 @@ 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);
