~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/definition/cache.cc

  • Committer: Brian Aker
  • Date: 2010-11-19 19:42:44 UTC
  • mto: (1945.2.1 quick)
  • mto: This revision was merged to the branch mainline in revision 1944.
  • Revision ID: brian@tangent.org-20101119194244-7vx6u5vwzvu9uvex
Remove dead getShare() call which should have been a call on the cache
directly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
namespace definition {
34
34
 
35
 
TableShare::shared_ptr Cache::find(const TableIdentifier &identifier)
 
35
TableShare::shared_ptr Cache::find(const TableIdentifier::Key &key)
36
36
{
37
37
  boost::mutex::scoped_lock scopedLock(_mutex);
38
38
 
39
 
  Map::iterator iter= cache.find(identifier.getKey());
 
39
  Map::iterator iter= cache.find(key);
40
40
  if (iter != cache.end())
41
41
  {
42
42
    return (*iter).second;
45
45
  return TableShare::shared_ptr();
46
46
}
47
47
 
48
 
void Cache::erase(const TableIdentifier &identifier)
 
48
void Cache::erase(const TableIdentifier::Key &key)
49
49
{
50
50
  boost::mutex::scoped_lock scopedLock(_mutex);
51
51
  
52
 
  cache.erase(identifier.getKey());
 
52
  cache.erase(key);
53
53
}
54
54
 
55
 
bool Cache::insert(const TableIdentifier &identifier, TableShare::shared_ptr share)
 
55
bool Cache::insert(const TableIdentifier::Key &key, TableShare::shared_ptr share)
56
56
{
57
57
  boost::mutex::scoped_lock scopedLock(_mutex);
58
58
  std::pair<Map::iterator, bool> ret=
59
 
    cache.insert(std::make_pair(identifier.getKey(), share));
 
59
    cache.insert(std::make_pair(key, share));
60
60
 
61
61
  return ret.second;
62
62
}