mirror of
https://github.com/null2264/yokai.git
synced 2025-06-20 10:14:50 +00:00
refactor(archive): Turn timespec function to extension method
This commit is contained in:
parent
fc87410d46
commit
1a16d84e61
1 changed files with 4 additions and 4 deletions
|
@ -65,10 +65,10 @@ private fun StructStat.toArchiveStat() = ArchiveEntry.StructStat().apply {
|
|||
stSize = st_size
|
||||
stBlksize = st_blksize
|
||||
stBlocks = st_blocks
|
||||
stAtim = timespec(st_atime)
|
||||
stMtim = timespec(st_mtime)
|
||||
stCtim = timespec(st_ctime)
|
||||
stAtim = st_atime.toTimespec()
|
||||
stMtim = st_mtime.toTimespec()
|
||||
stCtim = st_ctime.toTimespec()
|
||||
stIno = st_ino
|
||||
}
|
||||
|
||||
private fun timespec(tvSec: Long) = ArchiveEntry.StructTimespec().also { it.tvSec = tvSec }
|
||||
private fun Long.toTimespec() = ArchiveEntry.StructTimespec().also { it.tvSec = this }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue