Skip to content

Commit

Permalink
Merge pull request #161 from martinRenou/fix_xwidgets_image
Browse files Browse the repository at this point in the history
WIP - Fix ximage
  • Loading branch information
SylvainCorlay committed Jan 18, 2019
2 parents 71ee06e + 616bd50 commit 83f5439
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions include/xwidgets/xbinary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ namespace xw

namespace detail
{
inline const xeus::xjson* get_json(const xeus::xjson& patch,
const xjson_path_type& path)
inline const xeus::xjson* get_buffers(const xeus::xjson& patch,
const xjson_path_type& path)
{
const xeus::xjson* current = &patch;
for (const auto& item : path)
Expand Down Expand Up @@ -104,15 +104,7 @@ namespace xw
}
else
{
auto el = current->find(item);
if (el != current->end())
{
current = &(*el);
}
else
{
return nullptr;
}
current = &(*current)[item];
}
}
return current;
Expand Down Expand Up @@ -148,7 +140,7 @@ namespace xw
buffer_paths = xeus::xjson(buffers.size(), nullptr);
for (const auto& path : to_check)
{
const xeus::xjson* item = detail::get_json(patch, path);
const xeus::xjson* item = detail::get_buffers(patch, path);
if (item != nullptr && item->is_string())
{
const std::string leaf = item->get<std::string>();
Expand Down

0 comments on commit 83f5439

Please sign in to comment.