code: func (c *Configs) expandConfigVariables(newConfigVars []string) []configPair {
  	// Get mapping from old config vars list to new one.
  	mapping := make([]int, len(newConfigVars))
  	i := 0
  	for n, nk := range newConfigVars {
  		if i == len(c.ConfigVariables) || c.ConfigVariables[i] > nk {
  			mapping[n] = -1
  		} else if c.ConfigVariables[i] == nk {
  			mapping[n] = i
  			i++
  		} else {
  			// Must never happen because newConfigVars and c.configVariables are sorted ASC,
  			// and newConfigVars contain c.configVariables as a subset.
  			panic("unreachable code")
  		}
  	}
  	// Expands configName to match newConfigVars.
  	getNewconfigName := func(old configName) configName {
  		newConfig := make(configName, len(mapping))
  		for k, v := range mapping {
  			if v != -1 {
  				newConfig[k] = old[v]
  			}
  		}
  		return newConfig
  	}
  	// Compute new byConfig.
  	out := make([]configPair, 0, len(c.byConfig))
  	for _, pair := range c.byConfig {
  		out = append(out, configPair{getNewconfigName(pair.key), pair.value})
  	}
  	return out
  }
docs: // expandConfigVariables returns new configPair list for newConfigVars.