Shadowing a builtin CRT-A0001
Bug risk
Major
3 months ago4 years old
shadowing of predeclared identifier: new
321	for _, id := range s.conf.EvictedStores {
322		old[id] = struct{}{}
323	}
324	new := make(map[uint64]struct{})325	for _, id := range newCfg.EvictedStores {
326		new[id] = struct{}{}
327	}
shadowing of predeclared identifier: new
222	for _, id := range s.conf.EvictedStores {
223		old[id] = struct{}{}
224	}
225	new := make(map[uint64]struct{})226	for _, id := range newCfg.EvictedStores {
227		new[id] = struct{}{}
228	}
shadowing of predeclared identifier: new
252}
253
254// SwitchAPIServerLeader switches the API server leader.
255func (c *Cluster) SwitchAPIServerLeader(new pdpb.PDClient) bool {256	old := c.apiServerLeader.Load()
257	return c.apiServerLeader.CompareAndSwap(old, new)
258}
shadowing of predeclared identifier: new
 166}
 167
 168// CASClusterVersion sets the cluster version.
 169func (o *PersistOptions) CASClusterVersion(old, new *semver.Version) bool { 170	return atomic.CompareAndSwapPointer(&o.clusterVersion, unsafe.Pointer(old), unsafe.Pointer(new))
 171}
 172
shadowing of predeclared identifier: new
392}
393
394// pauseAndResumeLeaderTransfer checks the old and new store IDs, and pause or resume the leader transfer.
395func pauseAndResumeLeaderTransfer[T any](cluster *core.BasicCluster, old, new map[uint64]T) {396	for id := range old {
397		if _, ok := new[id]; ok {
398			continue