code: func (t *DatacentersTable) computeChanges(c context.Context, datacenters []*config.Datacenter) {
  	cfgs := make(map[string]*Datacenter, len(datacenters))
  	for _, cfg := range datacenters {
  		cfgs[cfg.Name] = &Datacenter{
  			Datacenter: config.Datacenter{
  				Name:        cfg.Name,
  				Description: cfg.Description,
  				State:       cfg.State,
  			},
  		}
  	}
  
  	for _, dc := range t.current {
  		if cfg, ok := cfgs[dc.Name]; ok {
  			// Datacenter found in the config.
  			if t.needsUpdate(dc, cfg) {
  				// Datacenter doesn't match the config.
  				cfg.Id = dc.Id
  				t.updates = append(t.updates, cfg)
  			}
  			// Record that the datacenter config has been seen.
  			delete(cfgs, cfg.Name)
  		} else {
  			// Datacenter not found in the config.
  			t.removals = append(t.removals, dc)
  		}
  	}
  
  	// Datacenters remaining in the map are present in the config but not the database.
  	// Iterate deterministically over the slice to determine which datacenters need to be added.
  	for _, cfg := range datacenters {
  		if dc, ok := cfgs[cfg.Name]; ok {
  			t.additions = append(t.additions, dc)
  		}
  	}
  }
docs: // computeChanges computes the changes that need to be made to the datacenters in the database.