@@ -406,8 +406,8 @@ func writeHeader(w io.Writer, h *header) error {
406
406
// flags.
407
407
if h .raw && ! h .hasDataDescriptor () {
408
408
b .uint32 (h .CRC32 )
409
- b .uint32 (uint32 (min64 (h .CompressedSize64 , uint32max )))
410
- b .uint32 (uint32 (min64 (h .UncompressedSize64 , uint32max )))
409
+ b .uint32 (uint32 (min (h .CompressedSize64 , uint32max )))
410
+ b .uint32 (uint32 (min (h .UncompressedSize64 , uint32max )))
411
411
} else {
412
412
// When this package handle the compression, these values are
413
413
// always written to the trailing data descriptor.
@@ -427,13 +427,6 @@ func writeHeader(w io.Writer, h *header) error {
427
427
return err
428
428
}
429
429
430
- func min64 (x , y uint64 ) uint64 {
431
- if x < y {
432
- return x
433
- }
434
- return y
435
- }
436
-
437
430
// CreateRaw adds a file to the zip archive using the provided [FileHeader] and
438
431
// returns a [Writer] to which the file contents should be written. The file's
439
432
// contents must be written to the io.Writer before the next call to [Writer.Create],
@@ -445,8 +438,8 @@ func (w *Writer) CreateRaw(fh *FileHeader) (io.Writer, error) {
445
438
return nil , err
446
439
}
447
440
448
- fh .CompressedSize = uint32 (min64 (fh .CompressedSize64 , uint32max ))
449
- fh .UncompressedSize = uint32 (min64 (fh .UncompressedSize64 , uint32max ))
441
+ fh .CompressedSize = uint32 (min (fh .CompressedSize64 , uint32max ))
442
+ fh .UncompressedSize = uint32 (min (fh .UncompressedSize64 , uint32max ))
450
443
451
444
h := & header {
452
445
FileHeader : fh ,
0 commit comments