~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sys_var.cc

  • Committer: Olaf van der Spek
  • Date: 2011-07-05 11:15:32 UTC
  • mto: This revision was merged to the branch mainline in revision 2367.
  • Revision ID: olafvdspek@gmail.com-20110705111532-zod5hduzwcqe01ea
Use boost::to_lower

Show diffs side-by-side

added added

removed removed

Lines of Context:
1424
1424
void add_sys_var_to_list(sys_var *var)
1425
1425
{
1426
1426
  string lower_name(var->getName());
1427
 
  transform(lower_name.begin(), lower_name.end(), lower_name.begin(), ::tolower);
 
1427
  boost::to_lower(lower_name);
1428
1428
 
1429
1429
  /* this fails if there is a conflicting variable name. */
1430
1430
  if (system_variable_map.count(lower_name))
1556
1556
 
1557
1557
sys_var *find_sys_var(const std::string &name)
1558
1558
{
1559
 
  string lower_name(name);
1560
 
  transform(lower_name.begin(), lower_name.end(), lower_name.begin(), ::tolower);
1561
 
 
1562
 
  sys_var *result= NULL;
1563
 
 
1564
 
  if (SystemVariableMap::mapped_type* ptr= find_ptr(system_variable_map, lower_name))
1565
 
    result= *ptr;
1566
 
 
1567
 
  if (result == NULL)
1568
 
  {
1569
 
    my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), name.c_str());
1570
 
    return NULL;
1571
 
  }
1572
 
 
1573
 
  return result;
 
1559
  if (sys_var* ptr= find_ptr2(system_variable_map, boost::to_lower_copy(name)))
 
1560
    return ptr;
 
1561
  my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), name.c_str());
 
1562
  return NULL;
1574
1563
}
1575
1564
 
1576
1565