~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/identifier/table.cc

  • Committer: Brian Aker
  • Date: 2010-10-26 21:56:22 UTC
  • mto: This revision was merged to the branch mainline in revision 1886.
  • Revision ID: brian@tangent.org-20101026215622-6fcmp520ouj5446p
Update Key to work a bit faster.

Show diffs side-by-side

added added

removed removed

Lines of Context:
322
322
  util::insensitive_hash hasher;
323
323
  hash_value= hasher(path);
324
324
 
325
 
  key.resize(getKeySize());
326
 
 
327
 
  std::copy(getSchemaName().begin(), getSchemaName().end(), key.begin());
328
 
  std::copy(getTableName().begin(), getTableName().end(), key.begin() + getSchemaName().length() + 1);
 
325
  key.set(getKeySize(), getSchemaName(), getTableName());
329
326
}
330
327
 
331
328
 
367
364
  message.set_schema(getSchemaName());
368
365
}
369
366
 
 
367
void TableIdentifier::Key::set(size_t resize_arg, const std::string &a, const std::string &b)
 
368
{
 
369
  key_buffer.resize(resize_arg);
 
370
 
 
371
  std::copy(a.begin(), a.end(), key_buffer.begin());
 
372
  std::copy(b.begin(), b.end(), key_buffer.begin() + a.length() + 1);
 
373
 
 
374
  util::sensitive_hash hasher;
 
375
  hash_value= hasher(key_buffer);
 
376
}
 
377
 
370
378
std::size_t hash_value(TableIdentifier const& b)
371
379
{
372
380
  return b.getHashValue();
373
381
}
374
382
 
 
383
std::size_t hash_value(TableIdentifier::Key const& b)
 
384
{
 
385
  return b.getHashValue();
 
386
}
 
387
 
375
388
} /* namespace drizzled */