Skip to content

Commit

Permalink
[log_vtab_manager] fix lookup_impl()
Browse files Browse the repository at this point in the history
  • Loading branch information
tstack committed Apr 9, 2017
1 parent fea3cb8 commit aae3cf4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/lnav.cc
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,7 @@ static void open_schema_view(void)
schema += "\n\n-- Virtual Table Definitions --\n\n";
schema += ENVIRON_CREATE_STMT;
schema += vtab_module_schemas;
for (log_vtab_manager::iterator vtab_iter =
lnav_data.ld_vtab_manager->begin();
for (auto vtab_iter = lnav_data.ld_vtab_manager->begin();
vtab_iter != lnav_data.ld_vtab_manager->end();
++vtab_iter) {
schema += "\n" + vtab_iter->second->get_table_statement();
Expand Down
10 changes: 8 additions & 2 deletions src/log_vtab_impl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,15 @@ public:
std::string register_vtab(log_vtab_impl *vi);
std::string unregister_vtab(intern_string_t name);

log_vtab_impl *lookup_impl(intern_string_t name)
log_vtab_impl *lookup_impl(intern_string_t name) const
{
return this->vm_impls[name];
log_vtab_impl *retval = nullptr;
auto iter = this->vm_impls.find(name);

if (iter != this->vm_impls.end()) {
retval = iter->second;
}
return retval;
};

iterator begin() const
Expand Down

0 comments on commit aae3cf4

Please sign in to comment.