@@ -130,7 +130,7 @@ func (m *Plugin) PostSchedule(ctx *types.SchedulingContext, res *types.Result) {
130130func (m * Plugin ) Score (ctx * types.SchedulingContext , pods []types.Pod ) map [types.Pod ]float64 {
131131 state := ctx .GetPluginState (types .PluginName (m .Name ())).(SchedulingContextState )
132132 total := len (state .PrefixHashes )
133- podScoreFunc := func (ctx * types. SchedulingContext , pod types.Pod ) float64 {
133+ podScoreFunc := func (pod types.Pod ) float64 {
134134 if total == 0 {
135135 return 0
136136 }
@@ -140,7 +140,7 @@ func (m *Plugin) Score(ctx *types.SchedulingContext, pods []types.Pod) map[types
140140
141141 scores := make (map [types.Pod ]float64 , len (pods ))
142142 for _ , pod := range pods {
143- scores [pod ] = podScoreFunc (ctx , pod )
143+ scores [pod ] = podScoreFunc (pod )
144144 }
145145 return scores
146146}
@@ -191,8 +191,8 @@ func hashPrompt(ctx *types.SchedulingContext, cacheBlockSize int, maxPrefixBlock
191191 for i := 0 ; i + cacheBlockSize <= len (prompt ); i += cacheBlockSize {
192192 block := prompt [i : i + cacheBlockSize ]
193193 prevBlockHash := res [len (res )- 1 ]
194- toHash : = append (block , toBytes (prevBlockHash )... )
195- res = append (res , BlockHash (xxhash .Sum64 (toHash )))
194+ block = append (block , toBytes (prevBlockHash )... )
195+ res = append (res , BlockHash (xxhash .Sum64 (block )))
196196 }
197197 return res
198198}
0 commit comments