~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/function.cc

  • Committer: Lee Bieber
  • Date: 2011-03-01 01:51:22 UTC
  • mfrom: (2209.1.3 build)
  • Revision ID: kalebral@gmail.com-20110301015122-jse47000xs6xp062
Merge Patrick - 726914: Need to update dbqp randgen config files for slave_plugin 
Merge Olaf - fix EOL
Merge Patrick - 725236: randgen transaction log tests need to be implemented using dbqp / randgen

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <drizzled/gettext.h>
27
27
#include <drizzled/plugin/function.h>
28
28
#include <drizzled/function_container.h>
29
 
 
 
29
#include <drizzled/util/find_ptr.h>
30
30
#include <drizzled/util/string.h>
31
31
 
32
32
namespace drizzled
41
41
 
42
42
bool plugin::Function::addPlugin(const plugin::Function *udf)
43
43
{
44
 
  if (FunctionContainer::getMap().find(udf->getName()) != FunctionContainer::getMap().end())
 
44
  if (FunctionContainer::getMap().count(udf->getName()))
45
45
  {
46
46
    errmsg_printf(error::ERROR,
47
47
                  _("A function named %s already exists!\n"),
49
49
    return true;
50
50
  }
51
51
 
52
 
  if (udf_registry.find(udf->getName()) != udf_registry.end())
 
52
  if (udf_registry.count(udf->getName()))
53
53
  {
54
54
    errmsg_printf(error::ERROR,
55
55
                  _("A function named %s already exists!\n"),
78
78
 
79
79
const plugin::Function *plugin::Function::get(const std::string &name)
80
80
{
81
 
  UdfMap::iterator iter= udf_registry.find(name);
82
 
  if (iter == udf_registry.end())
83
 
  {
84
 
    return NULL;
85
 
  }
86
 
  return iter->second;
 
81
  UdfMap::mapped_type* ptr= find_ptr(udf_registry, name);
 
82
  return ptr ? *ptr : NULL;
87
83
}
88
84
 
89
85
} /* namespace drizzled */