minor dead code: unused format string
Using URL base64 encoding (without padding, i.e. with trailing '=' or '==') hash string width is 256/6 = 43 characters. file size virtually unchanged, out/soong/build.ninja: 7,188,669,041 => 7,186,999,370 ie 1.6M Bug: N/A Test: manually verified (e.g. ran `m nothing` successfully) Change-Id: I166d613e1fd857555da9611d420d6691806571c7
This commit is contained in:
@@ -16,6 +16,7 @@ package bazel
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
@@ -295,7 +296,7 @@ func (a *aqueryArtifactHandler) artifactPathsFromDepsetHash(depsetHash string) (
|
||||
a.depsetHashToArtifactPathsCache[depsetHash] = result
|
||||
return result, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("undefined input depset hash %d", depsetHash)
|
||||
return nil, fmt.Errorf("undefined input depset hash %s", depsetHash)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,8 +391,8 @@ func depsetContentHash(directPaths []string, transitiveDepsetHashes []string) st
|
||||
h := sha256.New()
|
||||
// Use newline as delimiter, as paths cannot contain newline.
|
||||
h.Write([]byte(strings.Join(directPaths, "\n")))
|
||||
h.Write([]byte(strings.Join(transitiveDepsetHashes, "\n")))
|
||||
fullHash := fmt.Sprintf("%016x", h.Sum(nil))
|
||||
h.Write([]byte(strings.Join(transitiveDepsetHashes, "")))
|
||||
fullHash := base64.RawURLEncoding.EncodeToString(h.Sum(nil))
|
||||
return fullHash
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user