~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/definition/cache.cc

  • Committer: Brian Aker
  • Date: 2011-02-27 19:43:52 UTC
  • mfrom: (2192.4.9 iter)
  • Revision ID: brian@tangent.org-20110227194352-w48j3ey8nhonecsd
MergeĀ inĀ find_ptr

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <drizzled/session.h>
28
28
#include <drizzled/identifier/table.h>
29
29
#include <drizzled/definition/cache.h>
30
 
 
31
30
#include <drizzled/table/instance.h>
 
31
#include <drizzled/util/find_ptr.h>
32
32
 
33
33
namespace drizzled {
34
34
 
37
37
table::instance::Shared::shared_ptr Cache::find(const identifier::Table::Key &key)
38
38
{
39
39
  boost::mutex::scoped_lock scopedLock(_mutex);
40
 
 
41
 
  Map::iterator iter= cache.find(key);
42
 
  if (iter != cache.end())
43
 
  {
44
 
    return (*iter).second;
45
 
  }
46
 
 
 
40
  if (Map::mapped_type* ptr= find_ptr(cache, key))
 
41
    return *ptr;
47
42
  return table::instance::Shared::shared_ptr();
48
43
}
49
44