]> Cypherpunks.ru repositories - goredo.git/blobdiff - depfix.go
Storage optimisations for the same often used data
[goredo.git] / depfix.go
index bf048798aad0a15c613deff75662ba3d54b9e193..87ecd882961cf8026d2398dc0dcf4a96bbbac2c9 100644 (file)
--- a/depfix.go
+++ b/depfix.go
@@ -18,7 +18,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 package main
 
 import (
-       "bytes"
        "encoding/hex"
        "errors"
        "io"
@@ -150,7 +149,7 @@ func depFix(root string) error {
                                if err != nil {
                                        return ErrLine(err)
                                }
-                               if !bytes.Equal(hsh, theirHsh) {
+                               if hsh != string(theirHsh) {
                                        tracef(
                                                CDebug, "depfix: %s/%s -> %s: hash differs",
                                                root, entry.Name(), dep,
@@ -160,7 +159,7 @@ func depFix(root string) error {
                                fields = []recfile.Field{
                                        {Name: "Type", Value: DepTypeIfchange},
                                        {Name: "Target", Value: dep},
-                                       {Name: "Hash", Value: hex.EncodeToString(hsh)},
+                                       {Name: "Hash", Value: hex.EncodeToString([]byte(hsh))},
                                }
                                fields = append(fields, inode.RecfileFields()...)
                                fieldses[len(fieldses)-1] = fields