@@ -130,7 +130,7 @@ func (m *Plugin) PostSchedule(ctx *types.SchedulingContext, res *types.Result) {
130
130
func (m * Plugin ) Score (ctx * types.SchedulingContext , pods []types.Pod ) map [types.Pod ]float64 {
131
131
state := ctx .GetPluginState (types .PluginName (m .Name ())).(SchedulingContextState )
132
132
total := len (state .PrefixHashes )
133
- podScoreFunc := func (ctx * types. SchedulingContext , pod types.Pod ) float64 {
133
+ podScoreFunc := func (pod types.Pod ) float64 {
134
134
if total == 0 {
135
135
return 0
136
136
}
@@ -140,7 +140,7 @@ func (m *Plugin) Score(ctx *types.SchedulingContext, pods []types.Pod) map[types
140
140
141
141
scores := make (map [types.Pod ]float64 , len (pods ))
142
142
for _ , pod := range pods {
143
- scores [pod ] = podScoreFunc (ctx , pod )
143
+ scores [pod ] = podScoreFunc (pod )
144
144
}
145
145
return scores
146
146
}
@@ -191,8 +191,8 @@ func hashPrompt(ctx *types.SchedulingContext, cacheBlockSize int, maxPrefixBlock
191
191
for i := 0 ; i + cacheBlockSize <= len (prompt ); i += cacheBlockSize {
192
192
block := prompt [i : i + cacheBlockSize ]
193
193
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 )))
196
196
}
197
197
return res
198
198
}
0 commit comments