Skip to content

refactor: Change the inner structure of DateTime#267

Merged
Pr0methean merged 1 commit intozip-rs:masterfrom
sorairolake:change-datetime-inner-structure
Jan 10, 2025
Merged

refactor: Change the inner structure of DateTime#267
Pr0methean merged 1 commit intozip-rs:masterfrom
sorairolake:change-datetime-inner-structure

Conversation

@sorairolake
Copy link
Contributor

Hold the values ​​as packed date and packed time. This is the same as MS-DOS date and time which is the time representation in ZIP. Note that the second resolution is changed to 2 seconds.

This change reduces the size of DateTime from 8 bytes to 4 bytes.

mem::size_of mem::align_of
Before 8 2
After 4 2

@sorairolake sorairolake force-pushed the change-datetime-inner-structure branch 4 times, most recently from 9f3845f to 06d31e0 Compare December 2, 2024 12:33
Hold the values ​​as packed date and packed time. Note that the second
resolution is changed to 2 seconds.
@sorairolake sorairolake force-pushed the change-datetime-inner-structure branch from 06d31e0 to 9f4d1b8 Compare December 25, 2024 06:16
@Pr0methean Pr0methean added this pull request to the merge queue Jan 10, 2025
Merged via the queue into zip-rs:master with commit e3eb2f7 Jan 10, 2025
@Pr0methean Pr0methean mentioned this pull request Jan 10, 2025
@sorairolake sorairolake deleted the change-datetime-inner-structure branch January 11, 2025 04:42
@Pr0methean Pr0methean mentioned this pull request Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants