Mercurial > prosody-hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 13357:f424c9f1460b | 13358:2b8ec22988af |
|---|---|
| 422 ih = nil; | 422 ih = nil; |
| 423 end | 423 end |
| 424 end | 424 end |
| 425 | 425 |
| 426 if ih then | 426 if ih then |
| 427 return setmetatable({ file = ih }, index_mt); | 427 local first_length = string.unpack(ih:read(index_item_size)); |
| 428 return setmetatable({ file = ih; { start = 0; length = first_length } }, index_mt); | |
| 428 end | 429 end |
| 429 | 430 |
| 430 local index, err = build_list_index(username, host, datastore); | 431 local index, err = build_list_index(username, host, datastore); |
| 431 if not index then | 432 if not index then |
| 432 return index, err | 433 return index, err |
