Removed another usage of fmt.Sprintf.

This commit is contained in:
Sascha L. Teichmann 2015-06-21 18:36:26 +02:00
parent b74671ae63
commit 6f10be6d92

View File

@ -5,7 +5,6 @@
package main package main
import ( import (
"fmt"
"image" "image"
"image/draw" "image/draw"
"io/ioutil" "io/ioutil"
@ -89,7 +88,7 @@ func createParentLevel(oldDir string, jobs chan pyramidJob) (newDir string, err
newLevel := oldLevel - 1 newLevel := oldLevel - 1
log.Printf("Generating tiles of level %d", newLevel) log.Printf("Generating tiles of level %d\n", newLevel)
parentDir := filepath.Dir(oldDir) parentDir := filepath.Dir(oldDir)
newDir = filepath.Join(parentDir, strconv.Itoa(newLevel)) newDir = filepath.Join(parentDir, strconv.Itoa(newLevel))
@ -118,13 +117,13 @@ func createParentLevel(oldDir string, jobs chan pyramidJob) (newDir string, err
} }
for oz, nz := zMin, zMin; oz <= zMax; oz += 2 { for oz, nz := zMin, zMin; oz <= zMax; oz += 2 {
oz1 := fmt.Sprintf("%d.png", oz) oz1 := strconv.Itoa(oz) + ".png"
oz2 := fmt.Sprintf("%d.png", oz+1) oz2 := strconv.Itoa(oz+1) + ".png"
s1 := filepath.Join(ox1Dir, oz1) s1 := filepath.Join(ox1Dir, oz1)
s2 := filepath.Join(ox1Dir, oz2) s2 := filepath.Join(ox1Dir, oz2)
s3 := filepath.Join(ox2Dir, oz1) s3 := filepath.Join(ox2Dir, oz1)
s4 := filepath.Join(ox2Dir, oz2) s4 := filepath.Join(ox2Dir, oz2)
d := filepath.Join(nxDir, fmt.Sprintf("%d.png", nz)) d := filepath.Join(nxDir, strconv.Itoa(nz)+".png")
jobs <- pyramidJob{src: [4]string{s1, s2, s3, s4}, dst: d} jobs <- pyramidJob{src: [4]string{s1, s2, s3, s4}, dst: d}
nz++ nz++
} }
@ -179,7 +178,7 @@ func fuseTiles(jobs chan pyramidJob, done *sync.WaitGroup) {
for job := range jobs { for job := range jobs {
if err := fuseTile(scratch, &job); err != nil { if err := fuseTile(scratch, &job); err != nil {
log.Printf("WARN: Writing image failed: %s", err) log.Printf("WARN: Writing image failed: %s\n", err)
} }
} }
} }