~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/definition/cache.cc

  • Committer: Olaf van der Spek
  • Date: 2011-02-24 12:41:15 UTC
  • mto: (2209.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2207.
  • Revision ID: olafvdspek@gmail.com-20110224124115-sv18p0qz5e3l7nao
UseĀ 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* i= find_ptr(cache, key))
 
41
    return *i;
47
42
  return table::instance::Shared::shared_ptr();
48
43
}
49
44