Skip to content

Commit

Permalink
update everything
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePhD committed Sep 14, 2016
1 parent 0e56783 commit 3df6471
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
15 changes: 8 additions & 7 deletions single/sol/sol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

// This file was generated with a script.
// Generated 2016-09-14 04:01:54.009414 UTC
// This header was generated with sol v2.14.0 (revision 46b1077)
// Generated 2016-09-14 04:10:09.319129 UTC
// This header was generated with sol v2.14.0 (revision 0e56783)
// https://github.com/ThePhD/sol2

#ifndef SOL_SINGLE_INCLUDE_HPP
Expand Down Expand Up @@ -9979,7 +9979,7 @@ namespace sol {

// beginning of sol/simple_usertype_metatable.hpp

#include <map>
#include <unordered_map>

namespace sol {

Expand All @@ -10006,8 +10006,8 @@ namespace sol {
}
};

typedef std::map<std::string, std::unique_ptr<variable_wrapper>, std::less<>> variable_map;
typedef std::map<std::string, object, std::less<>> function_map;
typedef std::unordered_map<std::string, std::unique_ptr<variable_wrapper>> variable_map;
typedef std::unordered_map<std::string, object> function_map;

struct simple_map {
variable_map variables;
Expand All @@ -10031,15 +10031,16 @@ namespace sol {
}
}
string_detail::string_shim accessor = stack::get<string_detail::string_shim>(L, keyidx);
auto vit = variables.find(accessor.c_str());
std::string accessorkey = accessor.c_str();
auto vit = variables.find(accessorkey);
if (vit != variables.cend()) {
auto& varwrap = *(vit->second);
if (is_index) {
return varwrap.index(L);
}
return varwrap.new_index(L);
}
auto fit = functions.find(accessor.c_str());
auto fit = functions.find(accessorkey);
if (fit != functions.cend()) {
auto& func = (fit->second);
return stack::push(L, func);
Expand Down
11 changes: 6 additions & 5 deletions sol/simple_usertype_metatable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "usertype_metatable.hpp"
#include "object.hpp"
#include <vector>
#include <map>
#include <unordered_map>
#include <utility>

namespace sol {
Expand Down Expand Up @@ -53,8 +53,8 @@ namespace sol {
}
};

typedef std::map<std::string, std::unique_ptr<variable_wrapper>, std::less<>> variable_map;
typedef std::map<std::string, object, std::less<>> function_map;
typedef std::unordered_map<std::string, std::unique_ptr<variable_wrapper>> variable_map;
typedef std::unordered_map<std::string, object> function_map;

struct simple_map {
variable_map variables;
Expand All @@ -78,15 +78,16 @@ namespace sol {
}
}
string_detail::string_shim accessor = stack::get<string_detail::string_shim>(L, keyidx);
auto vit = variables.find(accessor.c_str());
std::string accessorkey = accessor.c_str();
auto vit = variables.find(accessorkey);
if (vit != variables.cend()) {
auto& varwrap = *(vit->second);
if (is_index) {
return varwrap.index(L);
}
return varwrap.new_index(L);
}
auto fit = functions.find(accessor.c_str());
auto fit = functions.find(accessorkey);
if (fit != functions.cend()) {
auto& func = (fit->second);
return stack::push(L, func);
Expand Down

0 comments on commit 3df6471

Please sign in to comment.