Skip to content

Commit 8a17287

Browse files
committed
use stdlib max func
1 parent e18c753 commit 8a17287

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

main.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,6 @@ func exists(path string) bool {
7474
return false
7575
}
7676

77-
func Max(x int64, y int64) int64 {
78-
if x < y {
79-
return y
80-
}
81-
return x
82-
}
83-
8477
func process(dry bool, verbose bool, perChunkMode bool, path string, newPath string, minTime int64) (err error) {
8578
moveRegions := len(newPath) != 0
8679

@@ -134,13 +127,13 @@ regionLoop:
134127

135128
xPos := chunk.XPos + chunk.Level.XPos
136129
zPos := chunk.ZPos + chunk.Level.ZPos
137-
inhabitedTime := Max(chunk.InhabitedTime, chunk.Level.InhabitedTime)
138-
130+
inhabitedTime := max(chunk.InhabitedTime, chunk.Level.InhabitedTime)
131+
139132
if inhabitedTime < 0 {
140133
log.Println("Skipping", file, "because of an invalid or unreadable chunk at x:", xPos, "z:", zPos, "InhabitedTime =", inhabitedTime)
141134
continue regionLoop
142135
}
143-
136+
144137
if perChunkMode {
145138
if inhabitedTime > minTime {
146139
if verbose {

0 commit comments

Comments
 (0)