mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user