mirror of
https://github.com/NixOS/nix.git
synced 2025-11-30 06:01:00 +01:00
Patch libzip to return timestamps in the Unix epoch
We're not even using those timestamps, but doing the conversion to local time takes a lot of time. For instance, this patch speeds up 'nix flake metadata nixpkgs` from 0.542s to 0.094s.
This commit is contained in:
parent
0286edb588
commit
1483c56582
3 changed files with 21 additions and 11 deletions
|
|
@ -35,7 +35,7 @@ struct ZipInputAccessor : InputAccessor
|
|||
: zipPath(_zipPath)
|
||||
{
|
||||
int error;
|
||||
zipFile = zip_open(zipPath.c_str(), 0, &error);
|
||||
zipFile = zip_open(zipPath.c_str(), ZIP_RDONLY, &error);
|
||||
if (!zipFile) {
|
||||
char errorMsg[1024];
|
||||
zip_error_to_str(errorMsg, sizeof errorMsg, error, errno);
|
||||
|
|
@ -68,16 +68,6 @@ struct ZipInputAccessor : InputAccessor
|
|||
if (!slash) continue;
|
||||
members.emplace(slash, sb);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Sigh, libzip returns a local time, so convert to Unix
|
||||
time. */
|
||||
if (lastModified) {
|
||||
struct tm tm;
|
||||
localtime_r(&lastModified, &tm);
|
||||
lastModified = timegm(&tm);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
~ZipInputAccessor()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue