mirror of https://github.com/containers/podman.git
Small optimization - only store exit code when nonzero
JSON optimizes it out in that case anyways, so don't waste cycles doing an Itoa (and Atoi on the decode side). Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
parent
d3a433181d
commit
62e8c328d8
|
|
@ -43,7 +43,9 @@ func (e EventJournalD) Write(ee Event) error {
|
|||
m["PODMAN_IMAGE"] = ee.Image
|
||||
m["PODMAN_NAME"] = ee.Name
|
||||
m["PODMAN_ID"] = ee.ID
|
||||
m["PODMAN_EXIT_CODE"] = strconv.Itoa(ee.ContainerExitCode)
|
||||
if ee.ContainerExitCode != 0 {
|
||||
m["PODMAN_EXIT_CODE"] = strconv.Itoa(ee.ContainerExitCode)
|
||||
}
|
||||
case Volume:
|
||||
m["PODMAN_NAME"] = ee.Name
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue