mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 19:22:49 +01:00
internal/shaderir: trim space before calc hash
This commit is contained in:
parent
7d3007a43e
commit
a5c221451a
@ -16,6 +16,7 @@
|
|||||||
package shaderir
|
package shaderir
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"go/constant"
|
"go/constant"
|
||||||
"go/token"
|
"go/token"
|
||||||
@ -35,7 +36,7 @@ type SourceHash [16]byte
|
|||||||
|
|
||||||
func CalcSourceHash(source []byte) SourceHash {
|
func CalcSourceHash(source []byte) SourceHash {
|
||||||
h := fnv.New128a()
|
h := fnv.New128a()
|
||||||
_, _ = h.Write(source)
|
_, _ = h.Write(bytes.TrimSpace(source))
|
||||||
|
|
||||||
var hash SourceHash
|
var hash SourceHash
|
||||||
h.Sum(hash[:0])
|
h.Sum(hash[:0])
|
||||||
|
Loading…
Reference in New Issue
Block a user