Skip to content

Commit

Permalink
More PR comments addressed.
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-parent committed Nov 13, 2024
1 parent 01ff792 commit 7a61a75
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions adobe/algorithm/append.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ namespace adobe {

/**************************************************************************************************/

/// Insert the _input range_ `r` at the end of the _sequence container_ `c`.
/// Returns an iterator pointing to the first element inserted, or `end(c)` if `r` is empty.
/// Insert the elements of _input_range_ `r` at the end of the _sequence container_ `c`,
/// returning the position corresponding to the incoming `end` of `c`.
template <class T, class R>
inline auto append(T& c, const R& r) {
return c.insert(std::end(c), std::begin(r), std::end(r));
Expand Down
5 changes: 3 additions & 2 deletions source/adam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ class sheet_t::implementation_t : boost::noncopyable {
void flow(cell_bits_t& priority_accessed);

/// Returns the output cell with the given name.
/// \pre the output cell must exist.
///
/// \pre A cell with that name exists.
cell_t& output_cell(const name_t& name) {
auto p = output_index_m.find(name);
assert(p != output_index_m.end() && "output cell not found");
Expand All @@ -359,7 +360,7 @@ class sheet_t::implementation_t : boost::noncopyable {
return *p;
}

/// Returns `true` if any output cells in the relation are resolved, false otherwise.
/// Returns whether any output cells in the relation are resolved.
bool resolved(const relation_t& relation) const {
return find_if(relation.name_set_m, [&](const auto& name) {
return output_cell(name).resolved_m;
Expand Down
15 changes: 8 additions & 7 deletions source/eve_evaluate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <mutex>

#include <adobe/algorithm/sort.hpp>
#include <adobe/algorithm/transform.hpp>
#include <adobe/array.hpp>
#include <adobe/cassert.hpp>
#include <adobe/dictionary.hpp>
Expand Down Expand Up @@ -198,8 +199,8 @@ eve_callback_suite_t bind_layout(const bind_layout_proc_t& proc, sheet_t& sheet,

eve_callback_suite_t suite;

suite.add_view_proc_m = std::bind(
proc, _1, _3, std::bind(&evaluate_named_arguments, std::ref(evaluator), _4));
suite.add_view_proc_m =
std::bind(proc, _1, _3, std::bind(&evaluate_named_arguments, std::ref(evaluator), _4));
suite.add_cell_proc_m = std::bind(&add_cell, std::ref(sheet), _1, _2, _3, _4);
suite.add_relation_proc_m = std::bind(&add_relation, std::ref(sheet), _1, _2, _3, _4);
suite.add_interface_proc_m =
Expand Down Expand Up @@ -321,16 +322,16 @@ void apply_layout_parameters(layout_attributes_t& data, const dictionary_t& para
dictionary_t::const_iterator iter(parameters.find(key_spacing));
if (iter != parameters.end()) {
if (iter->second.type_info() == typeid(array_t)) {
// REVISIT (sean-parent) : This could use a back inserter but this is overwriting
// starting at the second element (contains a default value). Maybe a simpler
// expression?
const array_t& spacing_array = iter->second.cast<array_t>();
data.spacing_m.resize(spacing_array.size() + 1);

layout_attributes_t::spacing_t::iterator dest_iter(data.spacing_m.begin() + 1);

for (array_t::const_iterator spacing_iter(spacing_array.begin());
spacing_iter != spacing_array.end(); ++spacing_iter) {
*dest_iter = spacing_iter->cast<int>();
++dest_iter;
}
transform(spacing_array, dest_iter,
[](const any_regular_t& x) { return x.cast<int>(); });
} else {
double tmp(data.spacing_m[1]);
iter->second.cast(tmp); // Try getting as number
Expand Down

0 comments on commit 7a61a75

Please sign in to comment.